New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes inability to stop or delete containers if DOCKER_ARGS used #21

Merged
merged 2 commits into from Apr 10, 2014

Conversation

Projects
None yet
2 participants
@yacn
Contributor

yacn commented Feb 24, 2014

Problem

If you set DOCKER_ARGS to anything in dvm.conf, you will be unable to stop or delete containers. For an example of what happens, you can look over this gist.

Solution

The solution is to modify the sed command to save the -g parameter passed into Docker in its init file. This parameter is needed because the directory docker expects (/var/lib/docker) is a symlink to /mnt/sda/var/lib/docker. See this thread for more information.

With the changes in this pull request, this will no longer happen:

|ruby-1.9.3-p448| isaacs-air in ~/git/yacn/dvm/tmp
± |fix/unable-to-stop-delete-containers ✗| → mv ~/.dvm/{fixed_,}Vagrantfile

|ruby-1.9.3-p448| isaacs-air in ~/git/yacn/dvm/tmp
± |fix/unable-to-stop-delete-containers ✗| → dvm up
Bringing machine 'dvm' up with 'virtualbox' provider...
[dvm] Importing base box 'boot2docker-0.5.4-1'...
*vagrant SNIP*
[dvm] Running provisioner: shell...
[dvm] Running: inline script
boot2docker: 0.5.4
---> Configuring docker with args '-H unix:// -H tcp://' and restarting

|ruby-1.9.3-p448| isaacs-air in ~/git/yacn/dvm/tmp
± |fix/unable-to-stop-delete-containers ✗| → kitchen list
Instance Driver Provisioner Last Action
default-ubuntu Docker ChefZero <Not Created>

|ruby-1.9.3-p448| isaacs-air in ~/git/yacn/dvm/tmp
± |fix/unable-to-stop-delete-containers ✗| → kitchen create
-----> Starting Kitchen (v1.2.1)
-----> Creating <default-ubuntu>...
Step 0 : FROM ubuntu
Pulling repository ubuntu
*kitchen create SNIP*
Finished creating <default-ubuntu> (3m8.39s).
-----> Kitchen is finished. (3m8.43s)

|ruby-1.9.3-p448| isaacs-air in ~/git/yacn/dvm/tmp
± |fix/unable-to-stop-delete-containers ✗| → kitchen destroy
-----> Starting Kitchen (v1.2.1)
-----> Destroying <default-ubuntu>...
2118a87d5cf2f5d6bc502a3f086b4ab828e6c3023624e2da9e8590eae043ec1f
2118a87d5cf2f5d6bc502a3f086b4ab828e6c3023624e2da9e8590eae043ec1f
Finished destroying <default-ubuntu> (0m0.14s).
-----> Kitchen is finished. (0m0.20s)

|ruby-1.9.3-p448| isaacs-air in ~/git/yacn/dvm/tmp
± |fix/unable-to-stop-delete-containers ✗| → kitchen list
Instance Driver Provisioner Last Action
default-ubuntu Docker ChefZero <Not Created>

|ruby-1.9.3-p448| isaacs-air in ~/git/yacn/dvm/tmp
± |fix/unable-to-stop-delete-containers ✗| →

(you can view the full output here)

I used this .kitchen.yml with this dvm.conf to confirm.

@fnichol

This comment has been minimized.

Show comment
Hide comment
@fnichol

fnichol Apr 10, 2014

Owner

@yacn, you are amazing, that is an awesome write up! So sorry this took weeks longer to pull in.

Owner

fnichol commented Apr 10, 2014

@yacn, you are amazing, that is an awesome write up! So sorry this took weeks longer to pull in.

fnichol added a commit that referenced this pull request Apr 10, 2014

Merge pull request #21 from yacn/fix/unable-to-stop-delete-containers
Fixes inability to stop or delete containers if DOCKER_ARGS used

@fnichol fnichol merged commit a417e2a into fnichol:master Apr 10, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment