Skip to content

Instantly share code, notes, and snippets.

@stephenmelrose
Created July 18, 2014 10:26
Show Gist options
  • Save stephenmelrose/70650f29891dfc1a0181 to your computer and use it in GitHub Desktop.
Save stephenmelrose/70650f29891dfc1a0181 to your computer and use it in GitHub Desktop.
Vagrant + Docker Order Problem
Bringing machine 'php' up with 'docker' provider...
Bringing machine 'nginx' up with 'docker' provider...
==> nginx: Building the container from a Dockerfile...
==> php: Building the container from a Dockerfile...
nginx: Image: 4e098e2a5456
php: Image: 799f14161316
==> nginx: Fixed port collision for 22 => 2222. Now on port 2200.
==> nginx: Creating the container...
nginx: Name: dmc-nginx
==> php: Fixed port collision for 22 => 2222. Now on port 2201.
nginx: Image: 4e098e2a5456
==> php: Creating the container...
nginx: Volume: /home/steve/work/docker-multi-container-example:/vagrant
php: Name: dmc-php
nginx: Port: 8080:80
php: Image: 799f14161316
nginx: Link: dmc-php:php
php: Volume: /home/steve/work/docker-multi-container-example:/vagrant
==> nginx: An error occurred. The error will be shown after all tasks complete.
php:
php: Container created: bfe9af64f39ad262
==> php: Starting container...
==> php: Provisioners will not be run since container doesn't support SSH.
An error occurred while executing multiple actions in parallel.
Any errors that occurred are shown below.
An error occurred while executing the action on the 'nginx'
machine. Please handle this error then try again:
A Docker command executed by Vagrant didn't complete successfully!
The command run along with the output from the command is shown
below.
Command: ["docker", "run", "--name", "dmc-nginx", "-d", "--link", "dmc-php:php", "-p", "8080:80", "-v", "/home/steve/work/docker-multi-container-example:/vagrant", "4e098e2a5456", {:notify=>[:stdout, :stderr]}]
Stderr: 2014/07/18 06:23:01 Error response from daemon: Could not find container for entity id bfe9af64f39ad262c68c39f3751b97eaaaf7e119a70c86883d8d18a55df56d5e
Stdout: a11a8421504c0f23758e4ab175f96e9e471d886d911ad2e76ab9e6bd43423c38
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Set default provider to docker
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'docker'
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# PHP container
config.vm.define 'php' do |php|
php.vm.provider "docker" do |docker|
docker.build_dir = "php"
docker.name = "dmc-php"
end
end
# nginx container
config.vm.define 'nginx' do |nginx|
nginx.vm.provider "docker" do |docker|
docker.build_dir = "nginx"
docker.name = "dmc-nginx"
docker.ports = ["8080:80"]
docker.link("dmc-php:php")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment