Merge pull request #2449 from djs55/docker-for-mac-files

docker-for-mac: supply the daemon.json via metadata
This commit is contained in:
Ian Campbell 2017-09-06 18:39:49 +01:00 committed by GitHub
commit 8e26838ed8
4 changed files with 13 additions and 13 deletions

View File

@ -33,13 +33,13 @@ $ moby build -name docker-for-mac base.yml docker-ce.yml
To run the VM with a 500M disk: To run the VM with a 500M disk:
``` ```
linuxkit run hyperkit -networking=vpnkit -vsock-ports=2376 -disk size=500M docker-for-mac linuxkit run hyperkit -networking=vpnkit -vsock-ports=2376 -disk size=500M -data ./metadata.json docker-for-mac
``` ```
In another terminal you should now be able to access docker via the socket `guest.00000947` in the state directory (`docker-for-mac-state/` by default): In another terminal you should now be able to access docker via the socket `guest.00000947` in the state directory (`docker-for-mac-state/` by default):
``` ```
$ docker -H unix://docker-for-mac-state/guest.00000947 ps $ docker -H unix://docker-for-mac-state/guest.00000948 ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
``` ```

View File

@ -7,6 +7,7 @@ init:
- linuxkit/init:6d11a1f9d299d3425e78cce80dfba8b236d20412 - linuxkit/init:6d11a1f9d299d3425e78cce80dfba8b236d20412
- linuxkit/runc:a1b564248a0d0b118c11e61db9f84ecf41dd2d2a - linuxkit/runc:a1b564248a0d0b118c11e61db9f84ecf41dd2d2a
- linuxkit/containerd:7d97282aebe36040fcdd3378a95562d440d34a9d - linuxkit/containerd:7d97282aebe36040fcdd3378a95562d440d34a9d
- linuxkit/ca-certificates:e44b0a66df5a102c0e220f0066b0d904710dcb10
onboot: onboot:
# support metadata for optional config in /var/config # support metadata for optional config in /var/config
- name: metadata - name: metadata
@ -23,12 +24,6 @@ onboot:
- name: mount - name: mount
image: linuxkit/mount:4fe245efb01384e42622c36302e13e386bbaeb08 image: linuxkit/mount:4fe245efb01384e42622c36302e13e386bbaeb08
command: ["/usr/bin/mountie", "/var/lib"] command: ["/usr/bin/mountie", "/var/lib"]
# create docker dir on mounted drive if it doesn't exist
- name: mkdir-docker
image: alpine:3.6
binds:
- /var/lib:/host_var_lib
command: ["sh", "-c", "mkdir -p /host_var_lib/docker"]
# mount-vpnkit mounts the 9p share used by vpnkit to coordinate port forwarding # mount-vpnkit mounts the 9p share used by vpnkit to coordinate port forwarding
- name: mount-vpnkit - name: mount-vpnkit
image: alpine:3.6 image: alpine:3.6

View File

@ -23,11 +23,8 @@ services:
"--swarm-default-advertise-addr=eth0", "--swarm-default-advertise-addr=eth0",
"--userland-proxy-path", "/usr/bin/vpnkit-expose-port", "--userland-proxy-path", "/usr/bin/vpnkit-expose-port",
"--storage-driver", "overlay2" ] "--storage-driver", "overlay2" ]
runtime:
files: mkdir: ["/var/lib/docker"]
- path: /var/config/docker/daemon.json
contents: '{ "debug": true }'
trust: trust:
org: org:
- library - library

View File

@ -0,0 +1,8 @@
{
"docker": {
"daemon.json": {
"perm": "0644",
"content": "{ \"debug\": true }"
}
}
}