RSS

docker (57) Versions 0.36.0

Installs/Configures Docker

Berkshelf
Librarian
Knife
cookbook 'docker', '~> 0.36.0'
cookbook 'docker', '~> 0.36.0'
knife cookbook site install docker
knife cookbook site download docker
README
Dependencies
Changelog
Foodcritic

chef-docker Build Status

Description

Installs/Configures Docker. Please see COMPATIBILITY.md for more information about Docker versions that are tested and supported by cookbook versions along with LWRP features.

This cookbook was inspired by @thoward's docker-cookbook: https://github.com/thoward/docker-cookbook

Breaking Change Alert

In version 1.0 of this cookbook, we will be making a significant breaking changes including the way that we handle the custom resources (docker_image, docker_container and docker_registry). It is highly recommended that you constrain the version of the cookbook you are using in the appropriate places. - metadata.rb - Chef Environments - Berksfile - Chef Policyfile

More details about specific changes will be documented in the 1.0_CHANGES.md file.

Requirements

Chef

  • Chef 11+

Platforms

  • Amazon 2014.03.1 (experimental)
  • CentOS 6
  • Debian 7
  • Fedora 19, 20
  • Mac OS X (only docker installation currently)
  • Oracle 6
  • RHEL 6
  • Ubuntu 12.04, 12.10, 13.04, 13.10, 14.04 (experimental)

Cookbooks

Opscode Cookbooks

Third-Party Cookbooks

Usage

Default Installation

  • Add recipe[docker] to your node's run list

Execution Drivers

If your system is running a Docker version before 0.9, you'll need to explicitly set up LXC outside of this cookbook. This will likely be true for most distros after Docker 1.0 and chef-docker 1.0 is released. * lxc on community site * lxc on Github

Storage Drivers

Beginning in chef-docker 1.0, storage driver installation and configuration is expected to be handled before this cookbook's execution, except where required by Docker.

AUFS

If you need AUFS support, consider adding the aufs cookbook to your node/recipe before docker. * aufs on community site * chef-aufs on Github

Then, set the storage_driver attribute of this cookbook to aufs.

device-mapper

If you need device-mapper support, consider adding the device-mapper cookbook to your node/recipe before docker. * device-mapper on community site * chef-device-mapper on Github

Then, set the storage_driver attribute of this cookbook to devicemapper (please note lack of dash).

Ubuntu 14.04 Package Installation via Docker PPA

By default, this cookbook will use the docker.io package from Ubuntu 14.04's repository. To use the Docker PPA package, just set the repo_url attribute to the Docker PPA URL. e.g. node.set['docker']['package']['repo_url'] = 'https://get.docker.io/ubuntu'

Attributes

Installation/System Attributes

These attributes are under the node['docker'] namespace.

Attribute Description Type Default
arch Architecture for docker binary (note: Docker only currently supports x86_64) String auto-detected (see attributes/default.rb)
group_members Users to manage in node['docker']['group'] Array of Strings []
init_type Init type for docker ("runit", "systemd", "sysv", or "upstart") String auto-detected (see attributes/default.rb)
install_dir Installation directory for docker binary (custom setting only valid for non-package installations) String auto-detected (see attributes/default.rb)
install_type Installation type for docker ("binary", "package" or "source") String package
ipv4_forward Sysctl set net.ipv4.ip_forward to 1 TrueClass, FalseClass true
ipv6_forward Sysctl set net.ipv6.conf.all.forwarding to 1 TrueClass, FalseClass true
version Version of docker String nil

Binary Installation Attributes

These attributes are under the node['docker']['binary'] namespace.

Attribute Description Type Default
checksum Optional SHA256 checksum for docker binary String auto-detected (see attributes/default.rb)
version Version of docker binary String node['docker']['version'] (if set) or latest
url URL for downloading docker binary String http://get.docker.io/builds/#{node['kernel']['name']}/#{node['docker']['arch']}/docker-#{node['docker']['binary']['version']}

Package Installation Attributes

These attributes are under the node['docker']['package'] namespace.

Attribute Description Type Default
action Action for docker packages ("install", "update", etc.) String install
distribution Distribution for docker packages String auto-detected (see attributes/default.rb)
name Override Docker package name String auto-detected (see attributes/default.rb)
repo_url Repository URL for docker packages String auto-detected (see attributes/default.rb)
repo_key Repository GPG key URL for docker packages String https://get.docker.io/gpg

Source Installation Attributes

These attributes are under the node['docker']['source'] namespace.

Attribute Description Type Default
ref Repository reference for docker source String master
url Repository URL for docker source String https://github.com/dotcloud/docker.git

Docker Daemon Attributes

For more information: http://docs.docker.io/en/latest/reference/commandline/cli/#daemon

These attributes are under the node['docker'] namespace.

Attribute Description Type Default
api_enable_cors Enable CORS headers in API TrueClass, FalseClass nil
bind_socket (DEPRECATED) Socket path that docker should bind String unix:///var/run/docker.sock
bind_uri (DEPRECATED) TCP URI docker should bind String nil
bip Use this CIDR notation address for the network bridge's IP, not compatible with bridge String nil
bridge Attach containers to a pre-existing network bridge; use 'none' to disable container networking String nil
debug Enable debug mode TrueClass, FalseClass nil (implicitly false)
dns DNS server(s) for containers String, Array nil
dns_search DNS search domain(s) for containers String, Array nil
exec_driver Execution driver for docker String nil (implicitly native as of 0.9.0)
graph Path to use as the root of the docker runtime String nil (implicitly /var/lib/docker)
group Group for docker socket and group_members String nil (implicitly docker)
host Socket(s) that docker should bind String, Array unix:///var/run/docker.sock
http_proxy HTTP_PROXY environment variable String nil
icc Enable inter-container communication TrueClass, FalseClass nil (implicitly true)
ip Default IP address to use when binding container ports String nil (implicitly 0.0.0.0)
iptables Enable Docker's addition of iptables rules TrueClass, FalseClass nil (implicitly true)
logfile Set custom DOCKER_LOGFILE String nil
mtu Set the containers network MTU Fixnum nil (implicitly default route MTU or 1500 if no default route is available)
no_proxy NO_PROXY environment variable String nil
options Additional options to pass to docker. These could be flags like "-api-enable-cors". String nil
pidfile Path to use for daemon PID file String nil (implicitly /var/run/docker.pid)
ramdisk Set DOCKER_RAMDISK when using RAM disk TrueClass or FalseClass false
restart Restart containers on boot TrueClass or FalseClass auto-detected (see attributes/default.rb)
selinux_enabled Enable SELinux TrueClass or FalseClass nil
storage_driver Storage driver for docker String nil
storage_opt Storage driver options String, Array nil
tls Use TLS TrueClass, FalseClass nil (implicitly false)
tlscacert Trust only remotes providing a certificate signed by the CA given here String nil (implicitly ~/.docker/ca.pem)
tlscert Path to TLS certificate file String nil (implicitly ~/.docker/cert.pem)
tlskey Path to TLS key file String nil (implicitly ~/.docker/key.pem)
tlsverify Use TLS and verify the remote (daemon: verify client, client: verify daemon) TrueClass, FalseClass nil (implicitly false)
tmpdir TMPDIR environment variable String nil

LWRP Attributes

These attributes are under the node['docker'] namespace.

Attribute Description Type Default
docker_daemon_timeout Timeout to wait for the docker daemon to start in seconds for LWRP commands Fixnum 10

docker_container Attributes

These attributes are under the node['docker'] namespace.

Attribute Description Type Default
container_cmd_timeout container LWRP default cmd_timeout seconds Fixnum 60
container_init_type Init type for docker containers (nil, "runit", "systemd", "sysv", or "upstart") String node['docker']['init_type']

docker_image Attributes

These attributes are under the node['docker'] namespace.

Attribute Description Type Default
image_cmd_timeout image LWRP default cmd_timeout seconds Fixnum 300

docker_registry Attributes

These attributes are under the node['docker'] namespace.

Attribute Description Type Default
registry_cmd_timeout registry LWRP default cmd_timeout seconds Fixnum 60

Recipes

  • recipe[docker] Installs/Configures Docker
  • recipe[docker::aufs] Installs/Loads AUFS Linux module
  • recipe[docker::binary] Installs Docker binary
  • recipe[docker::cgroups] Installs/configures default platform Control Groups support
  • recipe[docker::devicemapper] Installs/Configures Device Mapper
  • recipe[docker::group] Installs/Configures docker group
  • recipe[docker::lxc] Installs/configures default platform LXC support
  • recipe[docker::package] Installs Docker via package
  • recipe[docker::runit] Installs/Starts Docker via runit
  • recipe[docker::source] Installs Docker via source
  • recipe[docker::systemd] Installs/Starts Docker via systemd
  • recipe[docker::sysv] Installs/Starts Docker via SysV
  • recipe[docker::upstart] Installs/Starts Docker via Upstart

LWRPs

  • docker_container: container operations
  • docker_image: image/repository operations
  • docker_registry: registry operations

Getting Started

Here's a quick example of pulling the latest image and running a container with exposed ports (creates service automatically):

# Pull latest image
docker_image 'samalba/docker-registry'

# Run container exposing ports
docker_container 'samalba/docker-registry' do
  detach true
  port '5000:5000'
  env 'SETTINGS_FLAVOR=local'
  volume '/mnt/docker:/docker-storage'
end

Maybe you want to automatically update your private registry with changes from your container?

# Login to private registry
docker_registry 'https://docker-registry.example.com/' do
  username 'shipper'
  password 'iloveshipping'
end

# Pull tagged image
docker_image 'apps/crowsnest' do
  tag 'not-latest'
end

# Run container
docker_container 'crowsnest'

# Save current timestamp
timestamp = Time.new.strftime('%Y%m%d%H%M')

# Commit container changes
docker_container 'crowsnest' do
  repository 'apps'
  tag timestamp
  action :commit
end

# Push image
docker_image 'crowsnest' do
  repository 'apps'
  tag timestamp
  action :push
end

See full documentation for each LWRP and action below for more information.

docker_container

Below are the available actions for the LWRP, default being run.

These attributes are associated with all LWRP actions.

Attribute Description Type Default
cmd_timeout Timeout for docker commands (catchable exception: Chef::Provider::Docker::Container::CommandTimeout) Integer node['docker']['container_cmd_timeout']
command Command to run in or identify container String nil
container_name Name for container/service String nil

docker_container action :commit

These attributes are associated with this LWRP action.

Attribute Description Type Default
author Author for commit String nil
message Message for commit String nil
repository Remote repository String nil
run Configuration to be applied when the image is launched with docker run String nil
tag Specific tag for image String nil

Commit a container with optional repository, run specification, and tag:

docker_container 'myApp' do
  repository 'myRepo'
  tag Time.new.strftime("%Y%m%d%H%M")
  run '{"Cmd": ["cat", "/world"], "PortSpecs": ["22"]}'
  action :commit
end

docker_container action :cp

These attributes are associated with this LWRP action.

Attribute Description Type Default
destination Host path to copy file String nil
source Container path to get file String nil

Copying a file from container to host:

docker_container 'myApp' do
  source '/path/to/container/file'
  destination '/path/to/save/on/host'
  action :cp
end

docker_container action :export

These attributes are associated with this LWRP action.

Attribute Description Type Default
destination Host path to save tarball String nil

Exporting container to host:

docker_container 'myApp' do
  destination '/path/to/save/on/host.tgz'
  action :export
end

docker_container action :kill

These attributes are associated with this LWRP action.

Attribute Description Type Default
cookbook Cookbook to grab any templates String docker
init_type Init type for container service handling FalseClass, String node['docker']['container_init_type']
init_template Template to use for init configuration String nil
signal Signal to send to the container String nil (implicitly KILL)
socket_template Template to use for configuring socket (relevent for init_type systemd only) String nil

Kill a running container:

docker_container 'shipyard' do
  action :kill
end

Send SIGQUIT to a running container:

docker_container 'shipyard' do
  signal 'QUIT'
  action :kill
end

docker_container action :redeploy

Stops, removes, and runs a container. Useful for notifications from image build/pull.

Attributes for this action can be found in the stop, remove, and run actions.

Redeploy container when new image is pulled:

docker_image 'shipyard/shipyard' do
  action :pull
  notifies :redeploy, 'docker_container[shipyard]', :immediately
end

docker_container 'shipyard' do
  # Other attributes
  action :run
end

docker_container action :remove

These attributes are associated with this LWRP action.

Attribute Description Type Default
cookbook Cookbook to grab any templates String docker
force Force removal TrueClass, FalseClass nil
init_type Init type for container service handling FalseClass, String node['docker']['container_init_type']
init_template Template to use for init configuration String nil
socket_template Template to use for configuring socket (relevent for init_type systemd only) String nil

Remove a container:

docker_container 'shipyard' do
  action :remove
end

These attributes are associated with this LWRP action.

Attribute Description Type Default
link Link to remove from container String nil

Remove a container:

docker_container 'shipyard' do
  link 'foo'
  action :remove_link
end

docker_container action :remove_volume

These attributes are associated with this LWRP action.

Attribute Description Type Default
volume Volume(s) to remove from container String, Array nil

Remove a container:

docker_container 'shipyard' do
  volume %w(/extravol1 /extravol2)
  action :remove_volume
end

docker_container action :restart

These attributes are associated with this LWRP action.

Attribute Description Type Default
cookbook Cookbook to grab any templates String docker
init_type Init type for container service handling FalseClass, String node['docker']['container_init_type']
init_template Template to use for init configuration String nil
socket_template Template to use for configuring socket (relevent for init_type systemd only) String nil

Restart a container:

docker_container 'shipyard' do
  action :restart
end

docker_container action :run

By default, this will handle creating a service for the container when action is run or start. set['docker']['container_init_type'] = false or add init_type false for LWRP to disable this behavior.

These attributes are associated with this LWRP action.

Attribute Description Type Default
attach Attach container's stdout/stderr and forward all signals to the process TrueClass, FalseClass nil
cidfile File to store container ID String nil
container_name Name for container/service String nil
cookbook Cookbook to grab any templates String docker
cpu_shares CPU shares for container Fixnum nil
detach Detach from container when starting TrueClass, FalseClass nil
dns DNS servers for container String, Array nil
dns_search DNS search domains for container String, Array nil
entrypoint Overwrite the default entrypoint set by the image String nil
env Environment variables to pass to container String, Array nil
env_file Read in a line delimited file of ENV variables String nil
expose Expose a port from the container without publishing it to your host Fixnum, String, Array nil
hostname Container hostname String nil
image Image for container String LWRP name
init_type Init type for container service handling FalseClass, String node['docker']['container_init_type']
init_template Template to use for init configuration String nil
link Add link to another container String, Array nil
label Options to pass to underlying labeling system String nil
lxc_conf Custom LXC options String, Array nil
memory Set memory limit for container Fixnum nil
net Configure networking for container String nil
networking (DEPRECATED) Configure networking for container TrueClass, FalseClass true
opt Custom driver options String, Array nil
port Map network port(s) to the container Fixnum (DEPRECATED), String, Array nil
privileged Give extended privileges TrueClass, FalseClass nil
public_port (DEPRECATED) Map host port to container Fixnum nil
publish_exposed_ports Publish all exposed ports to the host interfaces TrueClass, FalseClass false
remove_automatically Automatically remove the container when it exits (incompatible with detach) TrueClass, FalseClass false
socket_template Template to use for configuring socket (relevent for init_type systemd only) String nil
stdin Attach container's stdin TrueClass, FalseClass nil
tty Allocate a pseudo-tty TrueClass, FalseClass nil
user User to run container String nil
volume Create bind mount(s) with: [host-dir]:[container-dir]:[rw ro]. If "container-dir" is missing, then docker creates a new volume. String, Array
volumes_from Mount all volumes from the given container(s) String nil
working_directory Working directory inside the container String nil

Run a container:

docker_container 'myImage' do
  detach true
end

Run a container via command:

docker_container 'busybox' do
  command 'sleep 9999'
  detach true
end

Run a container from image (docker-registry for example):

docker_container 'docker-registry' do
  image 'samalba/docker-registry'
  detach true
  hostname 'docker-registry.example.com'
  port '5000:5000'
  env 'SETTINGS_FLAVOR=local'
  volume '/mnt/docker:/docker-storage'
end

docker_container action :start

These attributes are associated with this LWRP action.

Attribute Description Type Default
attach Attach container's stdout/stderr and forward all signals to the cookbook Cookbook to grab any templates String
init_type Init type for container service handling FalseClass, String node['docker']['container_init_type']
init_template Template to use for init configuration String nil
socket_template Template to use for configuring socket (relevent for init_type systemd only) String nil
stdin Attach container's stdin TrueClass, FalseClass nil

Start a stopped container:

docker_container 'shipyard' do
  action :start
end

docker_container action :stop

These attributes are associated with this LWRP action.

Attribute Description Type Default
cookbook Cookbook to grab any templates String docker
init_type Init type for container service handling FalseClass, String node['docker']['container_init_type']
init_template Template to use for init configuration String nil
socket_template Template to use for configuring socket (relevent for init_type systemd only) String nil

Stop a running container:

docker_container 'shipyard' do
  action :stop
end

docker_container action :wait

Wait for a container to finish:

docker_container 'busybox' do
  command 'sleep 9999'
  action :wait
end

docker_image

Below are the available actions for the LWRP, default being pull.

These attributes are associated with all LWRP actions.

Attribute Description Type Default
cmd_timeout Timeout for docker commands (catchable exception: Chef::Provider::Docker::Image::CommandTimeout) Integer node['docker']['image_cmd_timeout']

docker_image action :build and :build_if_missing

These attributes are associated with this LWRP action.

Attribute Description Type Default
dockerfile (DEPRECATED) Dockerfile to build image String nil
image_url (DEPRECATED) URL to grab image String nil
no_cache Do not use the cache when building the image TrueClass, FalseClass false
path (DEPRECATED) Local path to files String nil
rm Remove intermediate containers after a successful build TrueClass, FalseClass false
source Source dockerfile/directory/URL to build String nil
tag Optional tag for image String nil

Build image from Dockerfile:

docker_image 'myImage' do
  tag 'myTag'
  source 'myImageDockerfile'
  action :build_if_missing
end

Build image from remote repository:

docker_image 'myImage' do
  source 'example.com/foo/myImage'
  tag 'myTag'
  action :build_if_missing
end

Conditionally rebuild image if changes upstream:

git "#{Chef::Config[:file_cache_path]}/docker-testcontainerd" do
  repository 'git@github.com:bflad/docker-testcontainerd.git'
  notifies :build, 'docker_image[bflad/testcontainerd]', :immediately
end

docker_image 'bflad/testcontainerd' do
  action :pull_if_missing
end

docker_image action :import

These attributes are associated with this LWRP action.

Attribute Description Type Default
image_url (DEPRECATED) URL to grab image String nil
repository Optional repository String nil
source Source file/directory/URL String nil
tag Optional tag for image String nil

Import image from local directory:

docker_image 'test' do
  source '/path/to/test'
  action :import
end

Import image from local file:

docker_image 'test' do
  source '/path/to/test.tgz'
  action :import
end

Import image from remote URL:

docker_image 'test' do
  source 'https://example.com/testimage.tgz'
  action :import
end

docker_image action :insert

ACTION DEPRECATED AS OF DOCKER 0.10.0

These attributes are associated with this LWRP action.

Attribute Description Type Default
destination Destination path/URL String nil
source Source path/URL String nil

Insert file from remote URL:

docker_image 'test' do
  source 'http://example.com/some/file.txt'
  destination '/container/path/for/some/file.txt'
  action :insert
end

docker_image action :load

These attributes are associated with this LWRP action.

Attribute Description Type Default
input Image source (via tar archive file) String nil
source Image source (via stdin) String nil

Load repository via input:

docker_image 'test' do
  input '/path/to/test.tar'
  action :load
end

Load repository via stdin:

docker_image 'test' do
  source '/path/to/test.tgz'
  action :load
end

docker_image action :pull and :pull_if_missing

These attributes are associated with this LWRP action.

Attribute Description Type Default
registry Optional registry server String nil
tag Optional tag for image String nil

Pull latest image every Chef run:

docker_image 'busybox'

Pull latest image only if missing:

docker_image 'busybox' do
  action :pull_if_missing
end

Pull tagged image:

docker_image 'bflad/test' do
  tag 'not-latest'
end

docker_image action :push

Push image (after logging in with docker_registry):

docker_image 'bflad/test' do
  action :push
end

docker_image action :remove

These attributes are associated with this LWRP action.

Attribute Description Type Default
force Force removal TrueClass, FalseClass nil
no_prune Do not delete untagged parents TrueClass, FalseClass nil

Remove image:

docker_image 'busybox' do
  action :remove
end

docker_image action :save

These attributes are associated with this LWRP action.

Attribute Description Type Default
destination Destination path (via stdout) String nil
output Destination path (via file) String nil
tag Save specific tag String nil

Save repository via file to path:

docker_image 'test' do
  destination '/path/to/test.tar'
  action :save
end

Save repository via stdout to path:

docker_image 'test' do
  destination '/path/to/test.tgz'
  action :save
end

docker_image action :tag

These attributes are associated with this LWRP action.

Attribute Description Type Default
force Force operation Boolean false
repository Remote repository String nil
tag Specific tag for image String nil

Tag image:

docker_image 'test' do
  repository 'bflad'
  tag '1.0.0'
  action :tag
end

docker_registry

These attributes are associated with all LWRP actions.

Attribute Description Type Default
cmd_timeout Timeout for docker commands (catchable exception: Chef::Provider::Docker::Registry::CommandTimeout) Integer node['docker']['registry_cmd_timeout']

docker_registry action :login

These attributes are associated with this LWRP action.

Attribute Description Type Default
email Registry email String nil
password Registry password String nil
username Registry username String nil

Log into or register with public registry:

docker_registry 'https://index.docker.io/v1/' do
  email 'publicme@example.com'
  username 'publicme'
  password 'hope_this_is_in_encrypted_databag'
end

Log into private registry with optional port:

docker_registry 'https://docker-registry.example.com:8443/' do
  username 'privateme'
  password 'still_hope_this_is_in_encrypted_databag'
end

Testing and Development

  • Quickly testing with Vagrant: VAGRANT.md
  • Full development and testing workflow with Test Kitchen and friends: TESTING.md

Contributing

Please see contributing information in: CONTRIBUTING.md

Maintainers

License

Please see licensing information in: LICENSE

Dependent cookbooks

yum-epel >= 0.0.0
sysctl >= 0.0.0
runit >= 0.0.0
modules >= 0.0.0
lxc >= 1.1.6
iptables >= 0.0.0
homebrew >= 0.0.0
golang >= 0.0.0
git >= 0.0.0
device-mapper >= 0.1.0
aufs >= 0.1.1
apt >= 0.0.0

Contingent cookbooks

amazon-ecs-agent Applicable Versions
cadvisor Applicable Versions
deis Applicable Versions
docker-docker-registry Applicable Versions
docker-mms Applicable Versions
docker-mongodb Applicable Versions
docker-mongodb-replset-configurator Applicable Versions
docker-nginx Applicable Versions
docker-nodejs Applicable Versions
docker-pm2 Applicable Versions
docker-python Applicable Versions
docker-redis Applicable Versions
docker_registry Applicable Versions
dokku Applicable Versions
drone Applicable Versions
mesos Applicable Versions

1.0.0 (unreleased)

  • Changed default Docker port to IANA assigned 2375

Attribute deprecations:

  • storage_type attribute renamed to storage_driver
  • virtualization_type attribute renamed to exec_driver
  • image LWRP dockerfile, image_url, and path attributes replaced with source attribute
  • container LWRP Fixnum port attribute: use full String notation from Docker documentation in port attribute instead
  • container LWRP public_port attribute: use port attribute instead
  • container LWRP networking attribute: use net attribute instead

0.36.0

  • Bugfix: [#181][]: Fixed remove_link action (thanks jperville).
  • Bugfix: [#185][]: Fix for non idempotent run action on docker_container (thanks bplunkert).
  • Bugfix: [#188][]: Applied temporary workaround to address the libcgmanager error to users running LXC on Ubuntu 14.04.
  • Bugfix: [#196][]: Address Helpers module naming conflict (thanks sethrosenblum).
  • Bugfix: [#200][]: Fix how service actions are handled by docker_container resource (thanks brianhartsock).
  • Bugfix: [#202][]: Correctly check for the kernel.release version on Debian (thanks Tritlo, paweloczadly).
  • Bugfix: [#203][]: Fix pull notifications for tagged images (thanks hobofan).
  • Bugfix: [#205][]: Fix current_resource.name assignments in docker_container provider (thanks jperville).
  • Bugfix: [#206][]: Fixes to container name detection (thanks jperville).
  • Enhancement: [#217][]: Explicitly set key and keyserver for docker apt repository (thanks sethrosenblum).
  • Improvement: Pull in init script changes from upstream for sysv and systemd.
  • Bugfix: [#219][]: Explicitly set Upstart provider for Ubuntu 14.04 and 14.10 (thanks methodx).
  • Improvement: [#220][]: Create graph directory if it is specified (thanks jontg).
  • Bugfix: [#224][]: Fix runit container template to properly use exec (thanks waisbrot).
  • Bugfix: Appropriately check for LXC when using the binary recipe on Fedora.
  • Bugfix: Implement workaround for docker/docker#2702 on Ubuntu 14.10.
  • Enhancement: [#221][]: Added NO_PROXY support (thanks jperville).
  • Various Test Suite Modifications
    • Enhancement: [#192][]: Allow image tags in serverspec matching (thanks bplunkert).
    • Bugfix: [#223][]: Convert a few occurrences of old 'should' rspec syntax to 'expect' (thanks jperville).
    • Disable a few platforms that are experiencing bugs unrelated to core functionality.
    • Address ChefSpec 4.1 deprecation warnings.
    • Update Berksfile to reference supermarket.getchef.com instead of api.berkshelf.com

0.35.2

  • Bugfix: #171: Default Ubuntu 14.04 to Docker PPA
  • Bugfix: #175: Do not set --selinux-enabled in opts unless explicitly defined for older versions
  • Bugfix: #176: Use docker host attribute in docker_container Upstart inotifywait

0.35.1

  • Bugfix: #172: Generate no cidfile by default, even when deploying as service
  • Bugfix: #173: Updated docker upstart script (should fix service docker restart)

0.35.0

After a long personal hiatus (sorry!), this is the last minor release before 1.0 of the cookbook. If you can handle the Docker port number change and don't use anything deprecated, upgrading to 1.0.X from 0.35.X of the cookbook should be very easy.

This release has a bunch of changes and hasn't been fully tested yet. Wanted to get it out there for broad testing. Please use caution!

Major kudos to @tduffield for the #147 PR, which includes: * Binary Installation * Added missing dependency resolution for using the binary. * Dependency Checks * Added docker::dep_check that will take an action if certain dependencies are not met. * node[docker][alert_on_error_action] = :fatal will kill the chef run and print the error message. * node[docker][alert_on_error_action] = :warn will print the error message but continue with the chef run. There is no guarantee that it will succeed though. * KitchenCI * Copied MiniTests to ServerSpec Tests * Added new platforms (Debian 7.4) * Changed provisioner from chef-solo to chef-zero * Removed Ubuntu 12.10 because it is not supported by Docker and the Kernel is bad and fails all the tests. * Removed tests for the source recipe. The dotcloud/docker repo actually doesn’t build any Go deliverables. * I think that the source recipe needs to be completely refactored.

Other awesome work merged:

  • #142: Bugfix: Redeploy breaks when a link is present
  • #139/#153/#154/#156/#157: Bugfix: container/image ID given as nil, fixes deprecated -notrunc
  • #164: Bugfix: Removing a container should also remove its cidfile
  • #166: Bugfix: Fix docker_inspect_id for Docker 1.0+
  • #158/#160/#165: Bugfix: Fix NameError when displaying error messages for timed-out commands
  • #169: Bugfix: Specify Upstart as service provider for cgroup on Ubuntu 14.04 (workaround for CHEF-5276, fixed in Chef 11.14)
  • #137/#138: Enhancement: Experimental Ubuntu 14.04 LTS support
  • #144: Enhancement: Experimental Amazon linux support
  • #150/#152: Enhancement: Add net attribute, deprecate networking
  • #168: Enhancement: Allow override of package name
  • #161: Enhancement: Add minitest case for SysV service
  • #149: Enhancement: Add --selinux-enabled daemon flag
  • Enhancement: container LWRP remove_link and remove_volume actions
  • Enhancement: Add storage-opt daemon flag
  • Enhancement: Add Docker 0.11.0, 0.11.1, 0.12.0, 1.0.0, 1.0.1 binary checksums

0.34.2

  • #141: Bugfix/Enhancement: Fix and enhance docker_image pull/push behavior with Docker 0.10
    • Removes deprecated --registry and --tag CLI args from docker_image pull
    • Adds support for registry attribute usage in docker_image pull and push
    • Adds support for tag attribute usage in docker_image push

0.34.1

  • #134: Bugfix: Fix docker_registry login handling, fixes #114

0.34.0

Attributes now available for all docker daemon flags as well as system IP forwarding.

  • REMOVED: container_dns* attributes (use replacement dns* attributes on daemon for all containers or docker_container dns* attributes instead)
  • DEPRECATED: bind_* attributes to match docker terminology (use host attribute instead)
  • Bugfix: #132: Do Not Explicitly Set storage_driver Attribute
  • Bugfix: #133: Remove explicit false defaults in resources
  • Bugfix: #114: Error executing action login on resource docker_registry
  • Enhancement: #115: Add IP forwarding attributes
  • Enhancement: #116: Docker 0.10.0: Add --no-prune to docker rmi
  • Enhancement: #117: Docker 0.10.0: Add --output flag to docker save (as well as tag support)
  • Enhancement: #118: Docker 0.10.0: Add --input flag to docker load
  • Enhancement: #119: Docker 0.10.0: Add support for --env-file to load environment variables from files
  • Enhancement: #120: Docker 0.10.0: Deprecate docker insert
  • Enhancement: #123: Add docker kill --signal
  • Enhancement: #124: Add all docker daemon options as attributes
  • Enhancement: #125: Use dns* attributes to set docker daemon options, not defaults per-container
  • Enhancement: #128: Add checksum attribute for binary downloads
  • Enhancement: #126: Set long option names for specified docker daemon options
  • Enhancement: #127: Use a helper function to specify single line docker daemon options

0.33.1

  • Bugfix: #112: Defines runner methods for ChefSpec matchers
  • Bugfix: #113: [D-15] Fedora 19 installs Docker 0.8.1, does not have the -G or -e flag

0.33.0

This release deprecates AUFS/device-mapper handling from chef-docker, but provides backwards compatibility by still including the default recipe of the new cookbooks. Please update your dependencies, Github watching/issues, and recipes to reflect the two new community cookbooks: * aufs: aufs on community site / chef-aufs on Github * device-mapper: device-mapper on community site / chef-device-mapper on Github

  • Bugfix: #109: Remove on lxc-net start from docker Upstart
  • Enhancement: #88: Migrate AUFS logic to separate cookbook
  • Enhancement: #90: Migrate device-mapper logic to separate cookbook
  • Enhancement: #110: Add docker Upstart pre-start script and limits configuration
  • Enhancement: #105: Add --label for docker run
  • Enhancement: #106: Add --opt for docker run
  • Enhancement: #107: Add --networking for docker run
  • Enhancement: #108: Add --dns-search for docker run
  • Enhancement: #104: Add TMPDIR
  • Enhancement: #111: Add DOCKER_LOGFILE configuration
  • Enhancement: container_dns* attributes to set --dns and --dns-search for all containers

0.32.2

  • Bugfix: #101: Explicitly install lxc on Ubuntu (when lxc is exec_driver; continue to fully support LXC as a default installation path since its been since Docker 0.1)
  • Bugfix: #103: Fix host argument (in docker run)

0.32.1

  • Bugfix: #98: Ensure Ruby 1.8 syntax is supported
  • Bugfix: Skip empty Array values in cli_args helper

0.32.0

If you're using CentOS/RHEL with EPEL, upcoming docker-io 0.9.0 package upgrade can be tracked at Bugzilla 1074880

This release includes Docker 0.9.0 changes and defaults, such as setting exec_driver to libcontainer ("native"), setting -rm on docker build, double dash arguments on the CLI, additional flags, etc.

  • DEPRECATED: Rename storage_type attribute to storage_driver to match Docker terminology (storage_type will be removed in chef-docker 1.0)
  • DEPRECATED: Rename virtualization_type attribute to exec_driver to match Docker terminology (virtualization_type will be removed in chef-docker 1.0)
  • Bugfix: #80: Use double dashed arguments on CLI
  • Bugfix: Surround String values on CLI with quotes
  • Enhancement: #77: Improved docker ps handling
  • Enhancement: #78: Docker 0.9.0: Make --rm the default for docker build
  • Enhancement: #81: Docker 0.9.0: Add a -G option to specify the group which unix sockets belong
  • Enhancement: #82: Docker 0.9.0: Add -f flag to docker rm to force removal of running containers
  • Enhancement: Add -f flag for docker rmi to force removal of images
  • Enhancement: #83: Docker 0.9.0: Add DOCKER_RAMDISK environment variable to make Docker work when the root is on a ramdisk
  • Enhancement: #84: Docker 0.9.0: Add -e flag for execution driver
  • Enhancement: #85: Docker 0.9.0: Default to libcontainer
  • Enhancement: #86: Add Chefspec LWRP matchers

0.31.0

Lots of init love this release. Now supporting runit.

Please note change of storage_type attribute from devmapper to devicemapper (and associated recipe name change) to match docker's name for the driver.

Cookbook now automatically adds -s option to init configurations if storage_type is defined, which is it by default. If you were specifying -s in the options attribute, you no longer need to do so. In my quick testing, docker daemon doesn't seem to mind if -s is specified twice on startup, although you'll probably want to get rid of the extra specification.

I've also dropped the LANG= and LC_ALL= locale environment settings from the Upstart job configuration. Its not specified in the default docker job. Please open an issue in docker project and here if for some reason this is actually necessary.

  • Bugfix: Match devicemapper storage_type attribute to match docker driver name (along with recipe name)
  • Enhancement: #72: Add initial runit init_type
  • Enhancement: #60: Automatically set docker -d -s from storage_type attribute
  • Enhancement: Simplify default/sysconfig file into one template (docker.sysconfig.erb) and source into SysV/Upstart init configurations
  • Enhancement: Add Debian docker daemon SysV init template

0.30.2

  • Bugfix: #68: Fix CommandTimeout handling in LWRPs
  • Bugfix: #67: Fix argument order to pull when tag specified

0.30.1

Public or private registry login should now correctly occur and login once per credentials change.

  • Bugfix: #64: Correct CLI ordering of registry login
  • Bugfix: #65: login command skipped in registry provider
  • Enhancement: registry provider current resource attributes loaded from .dockercfg

0.30.0

Awesome work by @jcrobak to close out two issues (#49 and #52) with #62. Note change below in image build action.

  • Bugfix: #52: return codes of docker commands not verified
  • Bugfix: Add missing pull_if_missing action to image resource
  • Enhancement: #56: Switch build action to build_if_missing, build action now builds each run (be careful with image growth!)
  • Enhancement: #59: Add Mac OS X installation support
  • Enhancement: #49: Add docker_cmd_timeout attribute and daemon verification
  • Enhancement: #58: Add container redeploy action
  • Enhancement: #63: Add group_members attribute and group recipe to manage docker group

0.29.0

  • Enhancement: #57: Implement id checking when determining current_resource
    • Added to both container and image LWRPs
  • Enhancement: Set created and status attributes for current container resources (for handlers, wrappers, etc.)
  • Enhancement: Set created and virtual_size attributes for image resource (for handlers, wrappers, etc.)

0.28.0

  • Enhancement: #55: image LWRP pull action now attempts pull every run (use pull_if_missing action for old behavior)

0.27.1

  • Bugfix: #51: container LWRP current_resource attribute matching should also depend on container_name

0.27.0

  • Enhancement: #48: Accept FalseClass CLI arguments (also explicitly declare =true for TrueClass CLI arguments)

0.26.0

  • Bugfix: Add SysV init script for binary installs
  • Enhancement: Add storage_type and virtualization_type attributes
  • Enhancement: Initial devmapper support for binary installs on CentOS/Ubuntu
  • Enhancement: #47 Debian-specific container SysV init script
  • Enhancement: #46 Add rm attribute for build action on image LWRP
  • Enhancement: Add no_cache attribute for build action on image LWRP

0.25.1

  • Bugfix: #44 Add missing run attribute for commit action on container LWRP

0.25.0

  • DEPRECATED: image LWRP dockerfile, image_url, and path attributes (replaced with source attribute)
  • Bugfix: Use docker_cmd for container LWRP remove and restart actions
  • Enhancement: Add registry LWRP with login action
  • Enhancement: Standardize on "smart" and reusable destination and source attributes for container and image LWRPs to define paths/URLs for various operations
  • Enhancement: Add commit, cp, export, and kill actions to container LWRP
  • Enhancement: Add insert, load, push, save, and tag actions to image LWRP
  • Enhancement: Add local file and directory support to import action of image LWRP
  • Enhancement: Add Array support to container LWRP link attribute
  • Enhancement: Cleaned up LWRP documentation

0.24.2

  • Bugfix: #43 Better formatting for container LWRP debug logging

0.24.1

  • Bugfix: Explicitly declare depends and supports in metadata
  • Bugfix: Handle container run action if container exists but isn't running

0.24.0

  • Bugfix: #42 fix(upstart): Install inotify-tools if using upstart
  • Enhancement: #38 Allow a user to specify a custom template for their container init configuration

0.23.1

  • Bugfix: #39 Fix NoMethodError bugs in docker::aufs recipe

0.23.0

  • Bugfix: Default oracle init_type to sysv
  • Enhancement: Experimental Debian 7 package support
  • Enhancement: Use new yum-epel cookbook instead of yum::epel recipe
  • Enhancement: Use value_for_platform where applicable in attributes, requires Chef 11

0.22.0

  • Enhancement: #35 Use kernel release for package name on saucy and newer
  • Enhancement: #37 dont include aufs recipe on ubuntu 13.10 and up; don't require docker::lxc for package installs

0.21.0

  • Enhancement: #31 More helpful cmd_timeout error messages and catchable exceptions for container (Chef::Provider::Docker::Container::CommandTimeout) and image (Chef::Provider::Docker::Image::CommandTimeout) LWRPs

0.20.0

0.19.1

  • Bugfix: #30 apt-get throws exit code 100 when upgrading docker

0.19.0

  • Enhancement: Add node['docker']['version'] attribute to handle version for all install_type (recommended you switch to this)
  • Enhancement: default['docker']['binary']['version'] attribute uses node['docker']['version'] if set
  • Enhancement: Add version handling to package recipe

0.18.1

  • Bugfix: Remove ExecStartPost from systemd service to match change in docker-io-0.7.0-13

0.18.0

  • Enhancement: CentOS/RHEL 6 package support via EPEL repository
  • Enhancement: Fedora 19/20 package support now in updates (stable) repository
  • Enhancement: sysv recipe and init_type

0.17.0

  • Removed: configuration recipe (see bugfix below)
  • Removed: config_dir attribute (see bugfix below)
  • Bugfix: Revert back to specifying HTTP_PROXY and "DOCKER_OPTS" natively in systemd/Upstart (mostly to fix up systemd support)
  • Bugfix: Add systemctl --system daemon-reload handling to systemd service template
  • Bugfix: Add || true to container systemd/Upstart pre-start in case already running
  • Bugfix: Locale environment already handled automatically by systemd
  • Enhancement: Switch Fedora package installation from goldmann-docker to Fedora updates-testing repository
  • Enhancement: Switch container LWRPs to named containers on Fedora since now supported
  • Enhancement: Update docker systemd service contents from docker-io-0.7.0-12.fc20
    • Add: Wants/After firewalld.service
    • Add: ExecStartPost firewall-cmd
    • Remove: ExecStartPost iptables commands

0.16.0

  • Bugfix: Remove protocol from docker systemd ListenStreams
  • Bugfix: Lengthen shell_out timeout for stop action in container LWRP to workaround Fedora being slow
  • Enhancement: Add service creation to container LWRP by default
    • Please thoroughly test before putting into production!
    • set['docker']['container_init_type'] = false or add init_type false for the LWRP to disable this behavior
  • Enhancement: Add configuration recipe with template
  • Enhancement: Add container_cmd_timeout attribute to easily set global container LWRP cmd_timeout default
  • Enhancement: Add image_cmd_timeout attribute to easily set global image LWRP cmd_timeout default
  • Enhancement: Add cookbook attribute to container LWRP
  • Enhancement: Add init_type attribute to container LWRP
  • Enhancement: Add locale support for Fedora
  • Enhancement: Fail Chef run if docker run command errors

0.15.0

  • Enhancement: Fedora 19/20 package support via Goldmann docker repo
  • Enhancement: docker.service / docker.socket systemd support
  • Enhancement: Add node['docker']['init_type'] attribute for controlling init system

0.14.0

  • Bugfix: #27 Only use command to determine running container if provided
  • Bugfix: #28 Upstart requires full stop and start of service instead of restart if job configuration changes while already running. Note even initctl reload-configuration isn't working as expected from http://upstart.ubuntu.com/faq.html#reload
  • Enhancement: #26 Add ability to set package action

0.13.0

  • Bugfix: Move LWRP updated_on_last_action(true) calls so only triggered when something actually gets updated
  • Enhancement: Add container LWRP wait action
  • Enhancement: Add attach and stdin args to container LWRP start action
  • Enhancement: Add link arg to container LWRP remove action
  • Enhancement: Use cmd_timeout in container LWRP stop action arguments

0.12.0

  • Bugfix: Add default bind_uri (nil) to default attributes
  • Enhancement: #24 bind_socket attribute added

0.11.0

  • DEPRACATION: container LWRP Fixnum port attribute: use full String notation from Docker documentation in port attribute instead
  • DEPRACATION: container LWRP public_port attribute: use port attribute instead
  • Enhancement: Additional container LWRP attributes:
    • cidfile
    • container_name
    • cpu_shares
    • dns
    • expose
    • link
    • lxc_conf
    • publish_exposed_ports
    • remove_automatically
    • volumes_from
  • Enhancement: Support Array in container LWRP attributes:
    • env
    • port
    • volume

0.10.1

  • Bugfix: Set default cmd_timeout in image LWRP to 300 instead of 60 because downloading images can take awhile
  • Enhancement: Change docker_test Dockerfile FROM to already downloaded busybox image instead of ubuntu
  • Enhancement: Add vagrant-cachier to Vagrantfile

Other behind the scenes changes: * Made cookbook code Rubocop compliant * Move licensing information to LICENSE file * Updated .travis.yml and Gemfile

0.10.0

  • Enhancement: #22 cmd_timeout, path (image LWRP), working_directory (container LWRP) LWRP attributes
  • Bugfix: #25 Install Go environment only when installing from source

0.9.1

  • Fix to upstart recipe to not restart service constantly (only on initial install and changes)

0.9.0

  • image LWRP now supports non-stdin build and import actions (thanks @wingrunr21!)

0.8.1

  • Fix in aufs recipe for FC048 Prefer Mixlib::ShellOut

0.8.0

Lots of community contributions this release -- thanks! * image LWRP now supports builds via Dockerfile * Additional privileged, public_port, and stdin parameters for container LWRP * Support specifying binary version for installation * Fix upstart configuration customization when installing via Apt packages * Default to Golang 1.1

0.7.1

  • Use HTTPS for Apt repository

0.7.0

  • Update APT repository information for Docker 0.6+

0.6.2

  • Change Upstart config to start on runlevels [2345] instead of just 3

0.6.1

  • Change env HTTP_PROXY to export HTTP_PROXY in Upstart configuration

0.6.0

  • Add bind_uri and options attributes

0.5.0

  • Add http_proxy attribute

0.4.0

  • Docker now provides precise/quantal/raring distributions for their PPA
  • Tested Ubuntu 13.04 support

0.3.0

  • Initial container LWRP

0.2.0

  • Initial image LWRP

0.1.0

  • Initial release
FC024: Consider adding platform equivalents: /tmp/cook/8fcff47b1e6fe7e33e7901fd/docker/recipes/package.rb:4
FC031: Cookbook without metadata file: /tmp/cook/8fcff47b1e6fe7e33e7901fd/docker/metadata.rb:1
FC045: Consider setting cookbook name in metadata: /tmp/cook/8fcff47b1e6fe7e33e7901fd/docker/metadata.rb:1
© 2008 – 2015 Chef Software, Inc. All Rights Reserved.

Code of Conduct