Commit Graph

287 Commits

Author SHA1 Message Date
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
Rolf Neugebauer
35e1444cf2 cli: Add option to specify hyperkit to use
Some users seem to have Docker for Mac/hyperkit in a non-standard
path. Allow them to specify the path to the hyperkit executable.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-31 19:21:02 +01:00
Rolf Neugebauer
b64f74bd27 cli: Add support for multiple backends for "moby run"
- Move HyperKit code into a separate file. It should be compilable
  on all supported OSes now.
- Add a (optional) subcommand to "moby run" to select a backend
  i.e., "moby run hyperkit [options] [prefix]"
- On macOS the default is "hyperkit" so that:
  "moby run [options] [prefix]"
  just works
- Add enough command line parsing to make it easy to add new
  backends to the run command
Update help messages.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-30 18:59:07 +01:00
Rolf Neugebauer
cc77b36bba cli: Move "run" flag processing into the run implmentation
While at it also fix up the HyperKit run help message.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-30 16:00:06 +01:00
Rolf Neugebauer
df292ed56e cli: Move "build" flag processing into build.go
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-30 15:59:52 +01:00
Rolf Neugebauer
9297e70def moby: Create custom formatter for Info() log events
This formatter strips the prefix from Info() events to
make the default output of "moby build" more readable.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-29 13:43:27 +01:00
Rolf Neugebauer
71ee15c005 moby: Add informational output to build
This adds log.Info() to the main steps of the "moby build"
process. By default the Info() output is shown to the user
so it provides some idea of progress and what is happening.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-29 10:53:18 +01:00
Rolf Neugebauer
32b32ea78d moby: Add debug logging to "moby build" code
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-29 10:25:28 +01:00
Rolf Neugebauer
6814e21c0a moby: Add verbose and quiet flags to moby commandline
These set the log level to Debug and Error. The default
log level is set to Info.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-29 10:25:28 +01:00
Rolf Neugebauer
7c6eca2e8e moby: Switch to use logrus instead of default logger
logrus offers better control over log-levels.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-29 10:25:28 +01:00