Command-line Completion

Command-line Completion Compose comes with command completion for the bash and zsh shell. Installing Command Completion Bash Make sure bash completion is installed. If you use a current Linux in a non-minimal installation, bash completion should be available. On a Mac, install with brew install bash-completion Place the completion script in /etc/bash_completion.d/ (/usr/local/etc/bash_completion.d/ on a Mac), using e.g. curl -L https://raw.githubusercontent.com/docker/compose/$(docker-compose

docker exec

exec Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...] Run a command in a running container -d, --detach Detached mode: run command in the background --detach-keys Specify the escape key sequence used to detach a container --help Print usage -i, --interactive Keep STDIN open even if not attached --privileged Give extended Linux capabilities to the command -t, --tty Allocate a pseudo-TTY

Networking in Compose

Networking in Compose Note: This document only applies if you’re using version 2 of the Compose file format. Networking features are not supported for version 1 (legacy) Compose files. By default Compose sets up a single network for your app. Each container for a service joins the default network and is both reachable by other containers on that network, and discoverable by them at a hostname identical to the container name. Note: Your app’s network is given a name based on the “project name

docker load

load Usage: docker load [OPTIONS] Load an image from a tar archive or STDIN --help Print usage -i, --input="" Read from a tar archive file, instead of STDIN. The tarball may be compressed with gzip, bzip, or xz -q, --quiet Suppress the load output. Without this option, a progress bar is displayed. Loads a tarred repository from a file or the standard input stream. Restores both images and tags. $ docker images REPOSITORY TAG IMAGE ID

Provision AWS EC2 Instances

Amazon Web Services (AWS) EC2 example Follow along with this example to create a Dockerized Amazon Web Services (AWS) EC2 instance. Step 1. Sign up for AWS and configure credentials If you are not already an AWS user, sign up for AWS to create an account and get root access to EC2 cloud computers. If you have an Amazon account, you can use it as your root user account. Create an IAM (Identity and Access Management) administrator user, an admin group, and a key pair associated with a region

docker events

events Usage: docker events [OPTIONS] Get real time events from the server -f, --filter=[] Filter output based on conditions provided --help Print usage --since="" Show all events created since timestamp --until="" Stream events until this timestamp Docker containers report the following events: attach, commit, copy, create, destroy, die, exec_create, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause, update Docke

Rescheduling

Swarm Rescheduling You can set recheduling policies with Docker Swarm. A rescheduling policy determines what the Swarm scheduler does for containers when the nodes they are running on fail. Rescheduling policies You set the reschedule policy when you start a container. You can do this with the reschedule environment variable or the com.docker.swarm.reschedule-policies label. If you don’t specify a policy, the default rescheduling policy is off which means that Swarm does not restart a container

Docker Glossary

Glossary A list of terms used around the Docker project. aufs aufs (advanced multi layered unification filesystem) is a Linux filesystem that Docker supports as a storage backend. It implements the union mount for Linux file systems. Base image An image that has no parent is a base image. boot2docker boot2docker is a lightweight Linux distribution made specifically to run Docker containers. The boot2docker management tool for Mac and Windows was deprecated and replaced by docker-machine which y

Docker Compose

Docker Compose Compose is a tool for defining and running multi-container Docker applications. To learn more about Compose refer to the following documentation: Compose Overview Install Compose Getting Started Get started with Django Get started with Rails Get started with WordPress Frequently asked questions Command line reference Compose file reference Environment file To see a detailed list of changes for past and current releases of Docker Compose, please refer to the CHANGELOG.

Run a simple application

Run a simple application In the “Hello world in a container“ you launched your first containers using the docker run command. You ran an interactive container that ran in the foreground. You also ran a detached container that ran in the background. In the process you learned about several Docker commands: docker ps - Lists containers. docker logs - Shows us the standard output of a container. docker stop - Stops running containers. Learn about the Docker client If you didn’t realize it yet