Merge "Nova-libvirt needs to bind to /sys/fs/cgroup"
[apex-tripleo-heat-templates.git] / docker / firstboot / start_docker_agents.sh
index caf511b..a0e95d1 100644 (file)
@@ -7,7 +7,7 @@ if ! hostname | grep compute &>/dev/null; then
  exit 0
 fi
 
-mkdir -p /var/lib/etc-data/ #FIXME: this should be a docker data container
+mkdir -p /var/lib/etc-data/json-config #FIXME: this should be a docker data container
 
 # heat-docker-agents service
 cat <<EOF > /etc/systemd/system/heat-docker-agents.service
@@ -38,23 +38,23 @@ EOF
 #echo "ADD_REGISTRY='--registry-mirror $docker_registry'" >> /etc/sysconfig/docker
 
 # Local docker registry 1.8
-#/bin/sed -i s/ADD_REGISTRY/#ADD_REGISTRY/ /etc/sysconfig/docker
+if [ $docker_namespace_is_registry ]; then
+    /bin/sed -i "s/# INSECURE_REGISTRY='--insecure-registry '/INSECURE_REGISTRY='--insecure-registry $docker_registry'/g" /etc/sysconfig/docker
+fi
 
 /sbin/setenforce 0
 /sbin/modprobe ebtables
 
-# Create /var/lib/etc-data for now.  FIXME: This should go into a data container.
-#mkdir -p /var/lib/etc-data
-
 echo nameserver 8.8.8.8 > /etc/resolv.conf
 
 # We need hostname -f to return in a centos container for the puppet hook
 HOSTNAME=$(hostname)
 echo "127.0.0.1 $HOSTNAME.localdomain $HOSTNAME" >> /etc/hosts
 
-# Another hack.. we need latest docker..
+# Another hack.. we need a different docker version
+# (should obviously be dropped once the atomic image contains docker 1.8.2)
 /usr/bin/systemctl stop docker.service
-/bin/curl -o /tmp/docker https://get.docker.com/builds/Linux/x86_64/docker-latest
+/bin/curl -o /tmp/docker https://get.docker.com/builds/Linux/x86_64/docker-1.8.2
 /bin/mount -o remount,rw /usr
 /bin/rm /bin/docker
 /bin/cp /tmp/docker /bin/docker