Ask Your Question
0

docker run multiple container

asked 2016-08-21 13:18:22 -0600

Raffaello gravatar image

using docker_platform module

i have this manifest:

class { 'docker':
  version => '1.12.1'
}

#docker::image { 'alpine': image_tag => 3.4 }

docker::image { 'uifd/ui-for-docker':
  image_tag => latest
}
##docker run -d -p 9000:9000 --privileged -v /var/run/docker.sock:/var/run/docker.sock uifd/ui-for-docker
docker::run { 'docker-ui':
  privileged => true,
  image => 'uifd/ui-for-docker',
  volumes => "/var/run/docker.sock:/var/run/docker.sock uifd/ui-for-docker",
  ports => '9000:9000',
  name => 'docker-ui',
  require => Docker::Image[ 'uifd/ui-for-docker' ],
  remove_container_on_stop  => false,
}

# docker run --name some-cassandra -d cassandra:tag
docker::image { 'cassandra': image_tag => 3.7 }
docker::run { 'cassandra-1':
  image => 'cassandra:3.7',
  name => 'cassandra-1',
  require => Docker::Image[ 'cassandra'],
  remove_container_on_stop  => false
#  tag => 3.7
}

##docker run --name some-cassandra2 -d --link some-cassandra:cassandra cassandra:tag
-> docker::run { 'cassandra-2':
  image => 'cassandra:3.7',
  links => 'cassandata-1:cassandra',
  name => 'cassandra-2',
  require => Docker::Image[ 'cassandra'],
  remove_container_on_stop  => false
#  tag => 'cassandra:3.7'
}

# docker run --name some-cassandra2 -d -e CASSANDRA_SEEDS="$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' some-cassandra)" cassandra:tag
# docker run --name some-cassandra2 -d --link some-cassandra:cassandra cassandra:tag

I am expecting to have 3 containers running on my puppet provided machine. instead i have only cassandra-1

why it is happening? What am I missing?

the output from Puppet it saying that is

Unscheduling refresh on Service.... for the missing one. Could it be related?

thank you

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-08-27 13:56:16 -0600

Raffaello gravatar image

oh well,

there was a typo on cassandra-2 and on the volume on docker ui... :

briefly wrong parameters passed.

docker::run { 'docker-ui':
  privileged => true,
  image => 'uifd/ui-for-docker',
  volumes => "/var/run/docker.sock:/var/run/docker.sock,
  ports => '9000:9000',
  name => 'docker-ui',
  require => Docker::Image[ 'uifd/ui-for-docker' ],
  remove_container_on_stop  => false,
}

docker::run { 'cassandra-2':
  image => 'cassandra:3.7',
  links => ['cassandra-1'],
  name => 'cassandra-2',
  require => Docker::Image[ 'cassandra'],
  remove_container_on_stop  => false
#  tag => 'cassandra:3.7'
}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-08-21 13:15:48 -0600

Seen: 131 times

Last updated: Aug 27 '16