From 25a05142a359f052260b9f1064be5519c6e4f00c Mon Sep 17 00:00:00 2001 From: David Scott Date: Tue, 22 Aug 2017 11:23:44 +0100 Subject: [PATCH] docker-for-mac: supply the daemon.json via metadata Previously the docker-for-mac example had a `files` declaration which wrote `/var/config/docker/daemon.json`. This was probably an error because the `/var/config` directory is owned by the `metadata` package. It used to work -- probably by accident -- but doesn't any more. This patch switches to using the metadata package to populate the `daemon.json`. Signed-off-by: David Scott --- blueprints/README.md | 2 +- blueprints/docker-for-mac/docker-ce.yml | 5 ----- blueprints/docker-for-mac/metadata.json | 8 ++++++++ 3 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 blueprints/docker-for-mac/metadata.json diff --git a/blueprints/README.md b/blueprints/README.md index b3f667d83..3847d5edf 100644 --- a/blueprints/README.md +++ b/blueprints/README.md @@ -33,7 +33,7 @@ $ moby build -name docker-for-mac base.yml docker-ce.yml 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): diff --git a/blueprints/docker-for-mac/docker-ce.yml b/blueprints/docker-for-mac/docker-ce.yml index 345b74353..2feb5522b 100644 --- a/blueprints/docker-for-mac/docker-ce.yml +++ b/blueprints/docker-for-mac/docker-ce.yml @@ -23,11 +23,6 @@ services: "--swarm-default-advertise-addr=eth0", "--userland-proxy-path", "/usr/bin/vpnkit-expose-port", "--storage-driver", "overlay2" ] - -files: - - path: /var/config/docker/daemon.json - contents: '{ "debug": true }' - trust: org: - library diff --git a/blueprints/docker-for-mac/metadata.json b/blueprints/docker-for-mac/metadata.json new file mode 100644 index 000000000..c7d11d2bb --- /dev/null +++ b/blueprints/docker-for-mac/metadata.json @@ -0,0 +1,8 @@ +{ + "docker": { + "daemon.json": { + "perm": "0644", + "content": "{ \"debug\": true }" + } + } +}