Commit Graph

309 Commits

Author SHA1 Message Date
Rolf Neugebauer
49d735bc2f cli: Unify environment variables for GCP run
GCP defines some "standard" environment variables for project and
zone. Use them for 'moby run gcp'. Change the other environment
variables to follow the same pattern.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-15 12:36:46 -05:00
Rolf Neugebauer
481d584659 cli: Update images to use the linuxkit hub org
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-12 21:28:17 +01:00
Ilya Dmitrichenko
31f5a0baa8 Generate VM UUID
Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
2017-04-12 17:33:26 +01:00
Thomas Gazagnaire
4504e6d386 fix yaml validation for image mounts
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
2017-04-12 15:28:02 +02:00
Justin Cormack
8f18d92bee Merge pull request #1599 from avsm/packet-net-run
Add `moby run packet` to boot on baremetal Packet.net hosts
2017-04-12 13:40:50 +01:00
Thomas Gazagnaire
b9a964060b better comment in converter for yaml validation
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
2017-04-12 14:10:27 +02:00
Anil Madhavapeddy
0175778e83 Add moby run packet to boot on baremetal Packet.net hosts
This uses the Packet.net API and iPXE to boot a Moby host.
There are several enhancements coming soon, such as SSH key
customisation, but this PR is sufficient to boot a host and
then use the web interface to get console access.

The user must currently upload the built artefacts to a public
URL and specify it via --base-url, e.g.:
moby run packet --api-key <key> --project-id <id> \
  --base-url http://recoil.org/~avsm/ipxe --hostname test-moby packet

See #1424 #1245 for related issues.

Signed-off-by: Anil Madhavapeddy <anil@docker.com>
2017-04-12 12:59:05 +01:00
Thomas Gazagnaire
02038f512d Add Yaml validation
Fix #1292

Transform the Yaml struct to JSON and validate it against a JSON schema.

Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
2017-04-12 13:42:15 +02:00
Justin Cormack
c9c6d20a45 Merge pull request #1596 from thebsdbox/qemu_raw_disk
Fixed qemu argument typo and also correct use of raw disk
2017-04-12 12:03:33 +01:00
thebsdbox
f7210ab4b4 Fixed qemu argument typo and also correct use of raw disk
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-04-12 11:19:58 +01:00
Dave Tucker
d5264ac9e7 moby: Add system disk and disk size parameter to GCP
This makes gcp behave in a similar way to the qemu backend.
The minimum size on GCP 1GB, whereas qemu uses 256MB.
Without this, the LTP tests fail on GCP.

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-12 00:52:01 +01:00
Dave Tucker
52f62bb30c moby: enable internet access for GCP VM's
Adds an "access config" with a type of "ONE_TO_ONE_NAT" that
allows an instance to obtain an ephemeral IP address and access the
internet

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-11 23:36:31 +01:00
thebsdbox
b6e8d4fd63 Added Linux $PATH support and fixed FlagSet typo
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-04-11 11:48:51 +01:00
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