summaryrefslogtreecommitdiffstats
path: root/docker/firstboot/setup_docker_host.sh
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-02-17 03:04:13 +0000
committerGerrit Code Review <review@openstack.org>2017-02-17 03:04:13 +0000
commit4fd12f1d18eaee79a299102df370281acf4dfac3 (patch)
tree3658ea45be68e41616b7c91679fed68bb038b451 /docker/firstboot/setup_docker_host.sh
parent1c486d57a89ed37b435bd344175301caaa32a489 (diff)
parentad2ea290bed17bff9b53ac225d3604ed642ee8bc (diff)
Merge "docker: new hybrid deployment architecture and configuration"
Diffstat (limited to 'docker/firstboot/setup_docker_host.sh')
-rwxr-xr-xdocker/firstboot/setup_docker_host.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/docker/firstboot/setup_docker_host.sh b/docker/firstboot/setup_docker_host.sh
new file mode 100755
index 00000000..b2287e91
--- /dev/null
+++ b/docker/firstboot/setup_docker_host.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+set -eux
+# TODO This would be better in puppet
+
+# TODO remove this when built image includes docker
+if [ ! -f "/usr/bin/docker" ]; then
+ yum -y install docker
+fi
+
+# NOTE(mandre) $docker_namespace_is_registry is not a bash variable but is
+# a place holder for text replacement done via heat
+if [ "$docker_namespace_is_registry" = "True" ]; then
+ /usr/bin/systemctl stop docker.service
+ # if namespace is used with local registry, trim all namespacing
+ trim_var=$docker_registry
+ registry_host="${trim_var%%/*}"
+ /bin/sed -i -r "s/^[# ]*INSECURE_REGISTRY *=.+$/INSECURE_REGISTRY='--insecure-registry $registry_host'/" /etc/sysconfig/docker
+fi
+
+# enable and start docker
+/usr/bin/systemctl enable docker.service
+/usr/bin/systemctl start docker.service
+
+# Disable libvirtd
+/usr/bin/systemctl disable libvirtd.service
+/usr/bin/systemctl stop libvirtd.service