Skip to content

Added docker_container action :create (wrapper to 'docker create').#242

Merged
tduffield merged 2 commits into
sous-chefs:masterfrom
PerfectMemory:container-action-create
Nov 26, 2014
Merged

Added docker_container action :create (wrapper to 'docker create').#242
tduffield merged 2 commits into
sous-chefs:masterfrom
PerfectMemory:container-action-create

Conversation

@jperville

Copy link
Copy Markdown
Contributor

This simple PR adds a new :create action to the docker_container LWRP.

The action wraps the docker create command (introduced with docker 1.3.0) which is the same as docker run except that it does not start the created container. The docker create command supports the same args as the docker run command except for a few (detach, security-opt, rm and sig-proxy if I believe the manual page).

@jperville

Copy link
Copy Markdown
Contributor Author

Please note that the current kitchen.yml on master does not run the minitest specs (no "recipe[minitest-handler]" in the different run lists). I fixed this for this PR, but to keep this PR focused I will submit the testing fixes in a separate PR.

@jperville

Copy link
Copy Markdown
Contributor Author

To make this PR usable I still need to improve the docker_container :redeploy action to make so that:

  • if the container is running then it will be redeployed with "docker run" (and will still be running after redeployment)
  • if the container is not running then it will be redeployed with "docker create" (and will still not be running after the redeployment)

If I leave the redeploy action as it is now, it may surprise the user to see a container that has been created (not run) then redeployed to be running after the redeployment.

There is a similar issue with services: when using created (not run) containers as a system services, the associated system service for the created container should not be enabled by default.

tduffield pushed a commit that referenced this pull request Nov 26, 2014
Added docker_container action :create (wrapper to 'docker create').
@tduffield tduffield merged commit 52424fc into sous-chefs:master Nov 26, 2014
@jperville jperville deleted the container-action-create branch September 21, 2015 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants