aboutsummaryrefslogtreecommitdiffstats
path: root/docker/firstboot
diff options
context:
space:
mode:
authorMartin André <m.andre@redhat.com>2016-07-26 11:31:49 +0200
committerMartin André <m.andre@redhat.com>2016-10-19 14:31:17 +0200
commite7cb607872e6f62b5ae199545877e5928bb0baaa (patch)
treeb7f57e7c35522352ea83b52b87c79f8ef0f9b650 /docker/firstboot
parent6d41f690331b28b88dcdc614ed10019a06ed88c2 (diff)
Bind mount files to run DiD in latest atomic host
The /usr/bin/docker is a shell script in latest atomic host, pointing to either docker-latest or docker-current binary. Bind mount the required files from atomic host to be able to run docker in docker inside heat-agents container. Co-Authored-By: Flavio Percoco <flavio@redhat.com> Change-Id: I97e29f65beb3a3f89c1b42c339e2e89f0fc1d519
Diffstat (limited to 'docker/firstboot')
-rw-r--r--docker/firstboot/start_docker_agents.sh23
1 files changed, 22 insertions, 1 deletions
diff --git a/docker/firstboot/start_docker_agents.sh b/docker/firstboot/start_docker_agents.sh
index 2431ef0a..acb44ce5 100644
--- a/docker/firstboot/start_docker_agents.sh
+++ b/docker/firstboot/start_docker_agents.sh
@@ -34,6 +34,25 @@ DOCKER_PULL_PID=$!
mkdir -p /var/lib/etc-data/json-config #FIXME: this should be a docker data container
+# NOTE(flaper87): Heat Agent required mounts
+AGENT_COMMAND_MOUNTS="-v /var/lib/etc-data:/var/lib/etc-data \
+ -v /run:/run \
+ -v /etc:/host/etc \
+ -v /usr/bin/atomic:/usr/bin/atomic \
+ -v /var/lib/dhclient:/var/lib/dhclient \
+ -v /var/lib/cloud:/var/lib/cloud \
+ -v /var/lib/heat-cfntools:/var/lib/heat-cfntools \
+ -v /etc/sysconfig/docker:/etc/sysconfig/docker \
+ -v /usr/lib64/libseccomp.so.2:/usr/lib64/libseccomp.so.2"
+
+
+# NOTE(flaper87): Some of these commands may not be present depending on the
+# atomic version.
+for docker_cmd in docker docker-current docker-latest; do
+ if [ -f "/usr/bin/$docker_cmd" ]; then
+ AGENT_COMMAND_MOUNTS+=" -v /usr/bin/$docker_cmd:/usr/bin/$docker_cmd"
+ fi
+done
# heat-docker-agents service
cat <<EOF > /etc/systemd/system/heat-docker-agents.service
@@ -48,7 +67,9 @@ User=root
Restart=on-failure
ExecStartPre=-/usr/bin/docker kill heat-agents
ExecStartPre=-/usr/bin/docker rm heat-agents
-ExecStart=/usr/bin/docker run --name heat-agents --privileged --net=host -v /var/lib/etc-data:/var/lib/etc-data -v /run:/run -v /etc:/host/etc -v /usr/bin/atomic:/usr/bin/atomic -v /var/lib/dhclient:/var/lib/dhclient -v /var/lib/cloud:/var/lib/cloud -v /var/lib/heat-cfntools:/var/lib/heat-cfntools -v /usr/bin/docker:/usr/bin/docker --entrypoint=/usr/bin/os-collect-config $agent_image
+ExecStart=/usr/bin/docker run --name heat-agents --privileged --net=host \
+ $AGENT_COMMAND_MOUNTS \
+ --entrypoint=/usr/bin/os-collect-config $agent_image
ExecStop=/usr/bin/docker stop heat-agents
[Install]