This PR aims to increase the consistency across the docs for code blocks and code/comment/output markings. Rule followed here is "what's visible on the screen should be reflected" Issue: - Docs had various code blocks showing: comments, commands & outputs. - All three of these items were inconsistently marked. Some examples as to how this PR aims to introduce improvements: 1. Removed `> ` from in front of the "outputs". Eg, ` > REPOSITORY TAG ID CREATED` replaced with: ` REPOSITORY TAG ID CREATED`. 2. Introduced `$` for commands. Eg, ` sudo chkconfig docker on` replaced with: ` $ sudo chkconfig docker on` 3. Comments: ` > # ` replaced with: ` # `. > Please note: > Due to a vast amount of items reviewed and changed for this PR, there > might be some individually incorrect replacements OR patterns of incorrect > replacements. This PR needs to be reviewed and if there is anything missing, > it should be improved or amended. Closes: https://github.com/dotcloud/docker/issues/5286 Docker-DCO-1.1-Signed-off-by: O.S. Tezer <ostezer@gmail.com> (github: ostezer)
2.1 KiB
page_title: Chef Usage page_description: Installation and using Docker via Chef page_keywords: chef, installation, usage, docker, documentation
Using Chef
Note
: Please note this is a community contributed installation path. The only
official
installation is using the Ubuntu installation path. This version may sometimes be out of date.
Requirements
To use this guide you'll need a working installation of Chef. This cookbook supports a variety of operating systems.
Installation
The cookbook is available on the Chef Community Site and can be installed using your favorite cookbook dependency manager.
The source can be found on GitHub.
Usage
The cookbook provides recipes for installing Docker, configuring init for Docker, and resources for managing images and containers. It supports almost all Docker functionality.
Installation
include_recipe 'docker'
Images
The next step is to pull a Docker image. For this, we have a resource:
docker_image 'samalba/docker-registry'
This is equivalent to running:
$ docker pull samalba/docker-registry
There are attributes available to control how long the cookbook will allow for downloading (5 minute default).
To remove images you no longer need:
docker_image 'samalba/docker-registry' do
action :remove
end
Containers
Now you have an image where you can run commands within a container managed by Docker.
docker_container 'samalba/docker-registry' do
detach true
port '5000:5000'
env 'SETTINGS_FLAVOR=local'
volume '/mnt/docker:/docker-storage'
end
This is equivalent to running the following command, but under upstart:
$ docker run --detach=true --publish='5000:5000' --env='SETTINGS_FLAVOR=local' --volume='/mnt/docker:/docker-storage' samalba/docker-registry
The resources will accept a single string or an array of values for any docker flags that allow multiple values.