Commit Graph

96 Commits

Author SHA1 Message Date
Anil Madhavapeddy
eae5422a0d tweak moby run CLI help to reflect that it supports GCP as well
Signed-off-by: Anil Madhavapeddy <anil@docker.com>
2017-04-11 11:18:55 +01:00
Justin Cormack
5527a3b6a1 Merge pull request #1577 from riyazdf/errchecking
catch and handle errors in src/cmd/moby
2017-04-10 21:48:41 +01:00
Riyaz Faizullabhoy
37adb881f7 catch and handle errors in src/cmd/moby
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-10 13:36:46 -07:00
Riyaz Faizullabhoy
0aaeb92a44 qemu: catch error on disk create and exit with message
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-10 12:09:54 -07:00
Justin Cormack
d11a78982a Merge pull request #1571 from dave-tucker/panic
Fix panic in gcp code
2017-04-10 17:37:52 +01:00
Dave Tucker
7d519cb9b8 moby: use type assertion to avoid panic in gcp code
Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-10 17:29:59 +01:00
Rolf Neugebauer
650d9011f4 cli: Adjust run_hyperkit to changed API
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-10 15:56:20 +01:00
Justin Cormack
66467544be Merge pull request #1521 from thebsdbox/qemu
CLI: Added qemu backend
2017-04-09 13:56:09 +01:00
thebsdbox
3446edbd0b CLI: Added qemu backend
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-04-09 13:49:00 +01:00
Riyaz Faizullabhoy
bd2211b645 trust: clean up logic for digests and orgs
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-08 17:25:18 -07:00
Justin Cormack
8176403426 system → onboot daemon → services
As suggested by @shykes these are clearer

- onboot for things that are run at boot time to completion
- services for persistent services

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-08 16:56:47 +01:00
Riyaz Faizullabhoy
68d8788e3b Enforce content trust with trust key and yaml subkeys for image and org
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-07 16:29:25 -07:00
Dave Tucker
799879d76d moby: Add -img-name flag to moby run gcp
This allows overriding the name used of the file in google storage,
image name or instance name. This will vary depending on how much `moby
run` is doing which is goverened by whether the positional argument
contains an `.img.tar.gz` or not.

For example:

`moby run gcp -img-name test-ea34d1 test` creates an instance called
`test-ea34d1` from the image `test`

`moby run gcp -img-name test-ea34d1` test.img.tar.gz` will upload the
file as `test-ea34d1.tar.gz`, create image `test-ea34d1` and create an
instance called `test-ea34d1`.

The use case for this is for CI to be able to spawn many concurrent test
machines and provide it's own name for them.

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-07 15:35:54 +01:00
Dave Tucker
0d8850d5d1 moby: Allow combination of env vars and flags for gcp
Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-07 15:22:27 +01:00
Justin Cormack
7e1f2088d3 Make init accept a list of images not just a single one.
fix #1527

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-07 14:25:28 +01:00
Justin Cormack
be9ee95c4c Write the initrd incrementally
Slightly better for demo flow as no long pause at the end

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-07 11:37:40 +01:00
Rolf Neugebauer
2cce03f19e cli: Add option to the IP address for HyperKit VM
Note: This currently requires a custom version of VPNKit.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-07 10:52:40 +01:00
Justin Cormack
7a5cdfd90c Merge pull request #1530 from ijc25/create-directories-from-yaml
Support creating of directories in files section
2017-04-07 10:28:23 +01:00
Ian Campbell
a3ac69639b Support creating of directories in files section
e.g.
    files:
     - path: etc/docker/daemon.json
       contents: '{"debug": true}'
     - path: var/lib/mydaemon
       directory: true

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-04-07 09:55:18 +01:00
Justin Cormack
430f03b6a0 Merge pull request #1522 from dave-tucker/gce-gcp
Use GCP everywhere for consistency
2017-04-06 17:27:15 +01:00
Dave Tucker
78c49b247a moby: Add gcp platform to usage in moby run
Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-06 17:10:04 +01:00
Dave Tucker
420661277a moby: Replace references to GCE with GCP
Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-06 17:00:53 +01:00
Justin Cormack
57e2076031 Add more OCI features
- masked paths
- readonly paths
- allow attaching to existing namespaces, eg if bind mounted by a system container

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-06 15:05:08 +01:00
Justin Cormack
781b05da9d Merge pull request #1514 from rneugeba/cli-up
Improvements to the CLI
2017-04-06 13:01:58 +01:00
Rolf Neugebauer
048218f7c8 cli: Add a 'version' version
Pass version and git commit hash from the Makefile
into main.go. Add a 'version' subcommand to print
the information.

While at it also tweak the help output to only print the
command name and not the entire path.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-06 12:29:52 +01:00
Rolf Neugebauer
ae4b9ba897 cli: Fix "build" when the basename contains a "."
Something like "moby-4.10.yml" did not work when invoked
like "moby build moby-4.10".

While at it, also allow .yaml as an extension.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-06 10:55:18 +01:00
Justin Cormack
d0aff83a21 Add more OCI options
- Sysctl
- CgroupsPath
- RootfsPropagation

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-05 20:46:16 +01:00
Justin Cormack
1602277ba7 Merge pull request #1492 from dave-tucker/gcp
Add gcp backend for moby run
2017-04-05 15:17:01 +01:00
Justin Cormack
bc1dd84337 Merge pull request #1500 from justincormack/mount-overrides
Allow overriding the default mount options
2017-04-05 15:13:06 +01:00
Justin Cormack
c1c71a7f68 Allow overriding the default mount options
This refactors the mount handling, without changing any defaults.

Any specification of a mount destination will override the default,
so if you want to make `sysfs` read only you can add

```
mounts:
  - type: sysfs
    options: ["ro"]
```

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-05 15:00:13 +01:00
Dave Tucker
6521cd05f8 run: Add gcp backend
This commit implements `moby run gcp` which allows for testing of moby
images on the Google Cloud Platform

This backend attaches (via SSH) to the serial console.
It generates instance-only SSH keys and adds the public key to the
image metadata. These are used by the `moby` tool only.

It will also automatically upload a file and creates an image if the prefix
given to `moby run` is a filename

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-05 14:50:23 +01:00
Dave Tucker
af16e13672 build: Use older GCP API and support service account auth
This commit uses the older GCP API as it supports both compute and
storage. As a result, we can now use either Application Default
Credentials that are generated using the `gcloud` tool or by supplying the
service account credentials in JSON format

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-05 14:50:16 +01:00
Justin Cormack
8d22f19618 Fix typo that meant modules were missing from image
fix #1393 thanks @deitch

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-05 13:24:42 +01:00
Justin Cormack
a7bda72430 Merge pull request #1496 from justincormack/all-caps
Allow setting capabilities to "all"
2017-04-05 13:04:26 +01:00
Justin Cormack
8de5ab5d74 Add the standard options Docker sets for /proc
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-05 11:52:17 +01:00
Justin Cormack
475d29eae1 Allow setting capabilities to "all"
This adds every capability. We had this before the OCI changes as we
passed these values to Docker. Makes fully privileged containers less verbose.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-05 11:18:46 +01:00
Justin Cormack
ee2f8bc7e3 Split out OCI generation function
This is to make unit testing easier for #1481

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-04 11:28:30 +01:00
Justin Cormack
69b96d3aa7 Merge pull request #1479 from justincormack/command
Revert Command->Args but remove from yaml where not needed
2017-04-04 10:49:32 +01:00
Justin Cormack
bd87295e43 Revert Command->Args but remove from yaml where not needed
In the riddler change I changed "command" in the yaml to "args"
but did not change the files. In fact we basically used the
default command everywhere so this did not actually break.

Remove the unnecessary "command" lines to simplify yaml.

Revert the command to args change for now as I think I prefer
command, but its easier to switch now. Need to think if the
entrypoint/command distinction matters before finalizing.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-04 09:51:17 +01:00
Justin Cormack
b6b7eb08d2 Disable log driver for docker run
We are generally outputting to stdout pipe which the log driver does
not cope with very well; always did this in older builds.

Saves another 5% of build time.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-04 09:36:25 +01:00
Rolf Neugebauer
c6ba8ab4eb Merge pull request #1447 from thebsdbox/vmware
VMware backend support
2017-04-04 09:07:25 +01:00
Justin Cormack
d293eeadf6 Replace riddler with code that constructs config.json directly
Generated largely from the specified config; small parts taken from `docker image inspect`,
such as the command line.

Renamed some of the yaml keys to match the OCI spec rather than Docker Compose as
we decided they are more readable, no more underscores.

Add some extra functionality
- tmpfs specification
- fully general mount specification
- no new privileges can be specified now

For nostalgic reasons, using engine-api to talk to the docker cli as
we only need an old API version, and it is nice and easy to vendor...

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-03 23:28:55 +01:00
Ian Campbell
1477639e09 Update to runc ef9a4b315558d31eae520725ff67383c2f79c3cb
This is compatible with containerd 8353da59c6ae7e1933aac2228df23541ef8b163f
which was picked up by d2caae4c1a.

This required jiggering with riddler output some more to update to new OCI
config.json format for capabilities.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-04-03 16:47:14 +01:00
thebsdbox
ab2ec26949 VMware Fusion 8.x / Workstation 12+ / VMware VIX vmrun support
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-04-03 14:19:13 +01:00
Rolf Neugebauer
156aab8b7d cli: Add support for passing meta data to a hyperkit VM
Add a -data option to the HyperKit "run" backend. This either
adds a string or a file to a ISO which is attached to the VM.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-02 19:35:45 +01:00
Rolf Neugebauer
2c91f6273f cli: Simplify run_hyperkit.go
Separating command line option parsing from executing hyperkit
makes the code awkward with many parameters passed between functions.

Having everything in one function makes the code simpler.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-02 19:33:25 +01:00
Rolf Neugebauer
681076f1a3 cli: Don't default to "moby" for run
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-02 19:33:25 +01:00
Rolf Neugebauer
397c4332f2 cli: Make the ".yml" extension optional for builds
This provides a consistent UX between build and run:
moby build foo   # build from foo.yml
moby run foo     # boot, e.g., foo-bzImage, foo-initrd.img

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-02 19:33:25 +01:00
Rolf Neugebauer
598dd31a7d cli: Don't default to moby.yml
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-02 19:33:25 +01:00
Rolf Neugebauer
5f9b98e8a7 cli: Use fixed mkimage-iso-efi image
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-01 16:25:02 +01:00