I'm using dockerio salt state to startup docker containers on a salt minion. Trying to mount volumes into my container is failing. Container is starting but volumes are not bound. What am I missing?
Aiming for this:
sudo docker run \
--volume=/var/run:/var/run:rw \
--volume=/sys/fs/cgroup/:/sys/fs/cgroup:ro \
--volume=/var/lib/docker/:/var/lib/docker:ro \
--publish=8080:8080 \
--detach=true \
google/cadvisor
cadvisor sls file
cadvisor-image:
docker.pulled:
- name: google/cadvisor
- tag: latest
- require_in: cadvisor-container
- force: True
cadvisor-container:
docker.installed:
- name: cadvisor
- hostname: cadvisor
- image: google/cadvisor
- ports:
- "8080/tcp"
- volumes:
- /var/run:/var/run
- /sys/fs/cgroup:/sys/fs/cgroup
- /var/lib/docker:/var/lib/docker
- require_in: cadvisor
cadvisor:
docker.running:
- container: cadvisor
- port_bindings:
"8080/tcp":
HostIp: ""
HostPort: "8080"
- binds:
/var/run:
bind: /var/run
rw: true
/sys/fs/cgroup:
bind: /sys/fs/cgroup
/var/lib/docker:
bind: /var/lib/docker
Versions
love@master:~$ cat /etc/issue
Ubuntu 12.04.1 LTS \n \l
love@master:~$ salt server01 cmd.run "docker version"
server01:
Client version: 1.1.1
Client API version: 1.13
Go version (client): go1.2.1
Git commit (client): bd609d2
Server version: 1.1.1
Server API version: 1.13
Go version (server): go1.2.1
Git commit (server): bd609d2
love@master:~$ salt server01 cmd.run "salt-minion --version"
server01:
salt-minion 2014.1.7
love@master:~$ salt --version
salt 2014.1.7