Commit Graph

66 Commits

Author SHA1 Message Date
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
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
Thomas Gazagnaire
0ab9624897 Fix typo in moby run
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
2017-03-28 11:08:28 +02:00
Rolf Neugebauer
9507f102cc Rename .yaml to .yml
docker-compose and other utilities use the .yml extension.
For consistency rename all .yaml to .yml

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-27 09:53:26 +02:00
Riyaz Faizullabhoy
594253b0a8 fmt string fixes
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-03-24 10:19:21 -07:00
Justin Cormack
af846e8014 Add a moby build --pull option to force pulling images
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-24 17:15:34 +00:00
Justin Cormack
630cafe592 Merge pull request #1378 from justincormack/riddler-files
Use Go code to extract rootfs from system containers
2017-03-24 13:36:51 +00:00
Justin Cormack
dd4ee77a23 Use Go code to extract rootfs from system containers
- this removes the use of riddler to extract the rootfs, use code
  we were using for rootfs. riddler now just geenrates the config,
  next stage is to generate this ourselves
- change the naming of the daemons so no longer include number as we
  do not guarantee ordering as they start up simultaneously

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-24 13:05:28 +00:00
Justin Cormack
c33896dcdc Merge pull request #1357 from thebsdbox/vmdk
added the capability to produce a vmdk file through Moby
2017-03-23 11:25:58 +00:00
dan
3fa494cb60 Added the capability to output moby images as vmdk files for use with VMware Workstation/Fusion
Corrected naming from vmware->vmdk and fixed Makfile

Fixed mistake outputting a vhd instead of a vmdk in output.go

Build vmdk image and added to Docker Hub, corrected link in output.go

Modified directories to confirm to standard mkimage-<imgType>

Signed-off-by: Dan Finneran <dan@thebsdbox.co.uk>
2017-03-23 11:16:40 +00:00
Justin Cormack
a2049a0da9 Merge pull request #1370 from justincormack/no-docker2tar
Remove docker2tar docker image, use Docker directly from Go
2017-03-23 09:44:21 +00:00
Justin Cormack
b63d27d405 Remove docker2tar docker image, use Docker directly from Go
Removing the left over indirect creates that use the Docker socket
and run in containers not directly.

See #1347

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-22 22:26:13 +00:00
Rolf Neugebauer
b8af990d62 moby: Log error when the kernel untar fails
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-22 15:14:17 +00:00
Rolf Neugebauer
d6e50e72d0 moby: Add a 'run' command to execute an image on hyperkit
'moby run' will use the kernel and initrd image produced
by 'moby build' and, on macOS, will run it inside a
hyperkit VM. This assumes that you have a recent version
of Docker for Mac installed as it re-uses the hyperkit
and VPNKit from it.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-22 14:47:56 +00:00
Rolf Neugebauer
7a6bc781de moby: Introduce the "build" subcommand
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-22 14:38:02 +00:00
Rolf Neugebauer
547a3e9380 moby: Factor out build code into a separate source file
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-22 14:38:02 +00:00
Justin Cormack
bede7847e3 Move Go code to src/cmd
This does not get everything where we want it finally, see #1266
nor the optimal way of building, but it gets it out of top level.

Added instructions to build if you have a Go installation.

Not moving `vendor` yet.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-21 14:37:23 +00:00
Justin Cormack
3c58702d42 Fix accidental removal of /etc/mtab from images
This was breaking some containers that use it, was a mistake.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-20 23:27:37 +00:00
Justin Cormack
4da9303b17 Output kernel command line to a file in the kernel+initrd output case
Trying to find the relevant yaml file was an issue as we now support
`--name` and it might be in a different directory, so although it is
a bit verbose outputing a whole file at least it is more consistent.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-20 13:43:09 +00:00
Justin Cormack
c4c7c1e8d8 Add a metadata handler for GCP which allows ssh login
- this needs improvements to make it more "platform native", in
  particular GCP supports multiple users and more ssh key mangement
  options.
- at present you can login as root with any platform ssh key
- add support for uts=host and ipc=host
- set the hostname from the metadata as well

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-16 18:45:44 +00:00
Justin Cormack
ee76e8bdfd GCP image handling enhancements
- the `public` option was not previously implemented
- add `replace` only for GCP images which will error otherwise. Only
  recommended for use in development, in production use the `--name` option
  to provide a different name eaxch time. Note only applies to GCP images,
  will document these options properly soon.
- add a `family` option; this allows you to upload many images and the
  user can select the latest using the `family` option instead of a specific
  image.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-16 13:20:21 +00:00
Justin Cormack
7149da4b4f Add a --name cli option to the moby tool
This sets the base name of the built images which otherwise
defaults to the basename of your yaml file. This allows
building different versions easily eg adding git sha to the
output names.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-16 11:51:49 +00:00
Justin Cormack
a7d650f5be Merge pull request #1307 from ijc25/isoefi-autosize
tools: Calculate EFI ESP FAT FS size based on contents.
2017-03-15 14:22:20 +00:00