ouea

Ruby code posted
created at 11 Dec 20:50

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  unless JSON.parse(`#{docker} inspect #{container_name}`).empty?
    sh "#{docker} rm -f #{container_name}"
  end
  puts "Creating image..."
  sh <<-EOF
    #{docker} \
      create \
      --restart=always \
      -v /etc/opt/docker/#{SYSTEM}/#{COMPONENT}:/opt/#{SYSTEM}/#{COMPONENT}/app/etc:ro \
      -v /var/opt/docker/#{SYSTEM}/#{COMPONENT}:/opt/#{SYSTEM}/#{COMPONENT}/app/var \
      --name #{container_name} \
      --publish 0.0.0.0:80:9292 \
      "#{REPOSITORY}:#{args[:image_tag]}"
  EOF
512 Bytes in 5 ms with coderay