Hi,
I am experiencing some weird behavior with docker, coreos and cloud-config. I have configured two units in my cloud-config, both are docker instances that need to be started on boot. When I provision a new server both unit files are created but only one is started. The weird thing is it always the first one in the configuration. So if change the order in the configuration the problem still exist it is just the other container that does not start.
Does anybody have a clue why this could be happening?
My configuration:
#cloud-config
hostname: "
registry.example.com"
coreos:
units:
- name: "registry.service"
command: "start"
enable: true
runtime: true
content: |
[Unit]
Description=Private Docker registry
After=docker.service
Requires=docker.service
[Service]
Restart=always
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill registry
ExecStartPre=-/usr/bin/docker rm registry
ExecStart=/usr/bin/docker pull registry
ExecStartPost=/usr/bin/docker run --name registry registry:2
ExecStop=/usr/bin/docker stop registry
[Install]
WantedBy=multi-user.target
- name: "redis.service"
command: "start"
enable: true
runtime: true
content: |
[Unit]
Description=Redis container
After=docker.service
Requires=docker.service
[Service]
Restart=always
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill redis
ExecStartPre=-/usr/bin/docker rm redis
ExecStart=/usr/bin/docker pull redis
ExecStartPost=/usr/bin/docker run --name redis redis
ExecStop=/usr/bin/docker stop redis
[Install]
WantedBy=multi-user.target