Skip to content
This repository has been archived by the owner on Jul 3, 2018. It is now read-only.

Commit

Permalink
Fix 'vagrant provision' for docker build/run
Browse files Browse the repository at this point in the history
The docker 'reprovision' is not clever enough to kill it's previous
incarnations, so manually do this in our docker 'setup step'.

This means 'vagrant provision' will rebuild and rerun the end-result
container, allowing us to iterate on the Dockerfile without destroy/up.

This takes the process down to 8m-ish, over 20m-ish.
  • Loading branch information
mikepea committed Feb 25, 2015
1 parent 29f398b commit e295b12
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ cat > /etc/default/docker << 'EOF'
DOCKER_OPTS="-H 0.0.0.0:#{DOCKER_PORT} -H unix:///var/run/docker.sock"
EOF
service docker restart
sleep 5

This comment has been minimized.

Copy link
@milosgajdos

milosgajdos Feb 25, 2015

I wonder how could we get around this ... somehow I'm not a fan of this :-)

(docker stop accelerated-claims ) >/dev/null 2>&1
(docker rm accelerated-claims || exit 0) >/dev/null 2>&1
(docker rmi -f accelerated-claims || exit 0) >/dev/null 2>&1

This comment has been minimized.

Copy link
@ashb

ashb Feb 25, 2015

Contributor

The use of sub-shells here is… interesting. Also if the container is running to start with won't the first stop fail?

How about something like this:

sleep 5
docker stop accelerated-claims >/dev/null 2>&1 || true
docker rm accelerated-claims >/dev/null 2>&1 || true
docker rmi -f accelerated-claims >/dev/null 2>&1|| true

This comment has been minimized.

Copy link
@mikepea

mikepea Feb 26, 2015

Author Contributor

Heh, yep I think the subshells was due to some kind of brain fart.

Will rebase as per above.

CONF

unless Vagrant.has_plugin?("vagrant-cachier")
Expand Down

0 comments on commit e295b12

Please sign in to comment.