Sha256: 8380618667548ca824eda504ffa542abbe001ce123864a660e3b15a67612d670

Contents?: true

Size: 1.73 KB

Versions: 2

Compression:

Stored size: 1.73 KB

Contents

def wheezy?
  return true if node['platform'] == 'debian' && node['platform_version'].to_i == 7
  false
end

if wheezy?
  file '/etc/apt/sources.list.d/wheezy-backports.list' do
    content 'deb http://ftp.de.debian.org/debian wheezy-backports main'
    notifies :run, 'execute[wheezy apt update]', :immediately
    action :create
  end

  execute 'wheezy apt update' do
    command 'apt-get update'
    action :nothing
  end
end

# installation
docker_installation_package 'default' do
  action :create
end

# service named 'default'
docker_service_manager_sysvinit 'default' do
  graph '/var/lib/docker'
  host 'unix:///var/run/docker.sock'
  action :start
end

docker_image 'busybox' do
  host 'unix:///var/run/docker.sock'
end

docker_container 'service default echo server' do
  container_name 'an_echo_server'
  repo 'busybox'
  command 'nc -ll -p 7 -e /bin/cat'
  port '7'
  action :run
end

# service A
docker_service_manager_sysvinit 'one' do
  graph '/var/lib/docker-one'
  host 'unix:///var/run/docker-one.sock'
  action :start
end

docker_image 'hello-world' do
  host 'unix:///var/run/docker-one.sock'
  tag 'latest'
end

docker_container 'hello-world' do
  host 'unix:///var/run/docker-one.sock'
  command '/hello'
  action :create
end

# service B
docker_service_manager_sysvinit 'two' do
  graph '/var/lib/docker-two'
  host 'unix:///var/run/docker-two.sock'
  action :start
end

docker_image 'alpine' do
  host 'unix:///var/run/docker-two.sock'
  tag '3.1'
end

docker_container 'service two echo_server' do
  container_name 'an_echo_server'
  repo 'alpine'
  tag '3.1'
  command 'nc -ll -p 7 -e /bin/cat'
  port '7'
  host 'unix:///var/run/docker-two.sock'
  action :run
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chef-12.8.1 acceptance/top-cookbooks/test_run/docker/test/cookbooks/docker_test/recipes/service_sysvinit_multi.rb
chef-12.8.1-universal-mingw32 acceptance/top-cookbooks/test_run/docker/test/cookbooks/docker_test/recipes/service_sysvinit_multi.rb