Provision hosts in the cloud

Use Docker Machine to provision hosts on cloud providers Docker Machine driver plugins are available for many cloud platforms, so you can use Machine to provision cloud hosts. When you use Docker Machine for provisioning, you create cloud hosts with Docker Engine installed on them. You’ll need to install and run Docker Machine, and create an account with the cloud provider. Then you provide account verification, security credentials, and configuration options for the providers as flags to docke

Extending Services in Compose

Extending services and Compose files Compose supports two methods of sharing common configuration: Extending an entire Compose file by using multiple Compose files Extending individual services with the extends field Multiple Compose files Using multiple Compose files enables you to customize a Compose application for different environments or different workflows. Understanding multiple Compose files By default, Compose reads two files, a docker-compose.yml and an optional docker-compose.ov

docker-machine active

active See which machine is “active” (a machine is considered active if the DOCKER_HOST environment variable points to it). $ docker-machine ls NAME ACTIVE DRIVER STATE URL dev - virtualbox Running tcp://192.168.99.103:2376 staging * digitalocean Running tcp://203.0.113.81:2376 $ echo $DOCKER_HOST tcp://203.0.113.81:2376 $ docker-machine active staging

Default bridge network

Docker default bridge network With the introduction of the Docker networks feature, you can create your own user-defined networks. The Docker default bridge is created when you install Docker Engine. It is a bridge network and is also named bridge. The topics in this section are related to interacting with that default bridge network. Understand container communication Legacy container links Binding container ports to the host Build your own bridge Configure container DNS Customize the docker0

docker-machine start

start Usage: docker-machine start [arg...] Start a machine Description: Argument(s) are one or more machine names. For example: $ docker-machine start dev Starting VM...

Seccomp security profiles for Docker

Seccomp security profiles for Docker Secure computing mode (Seccomp) is a Linux kernel feature. You can use it to restrict the actions available within the container. The seccomp() system call operates on the seccomp state of the calling process. You can use this feature to restrict your application’s access. This feature is available only if Docker has been built with seccomp and the kernel is configured with CONFIG_SECCOMP enabled. To check if your kernel supports seccomp: $ cat /boot/config-

Deprecated Engine Features

Deprecated Engine Features The following list of features are deprecated in Engine. -e and --email flags on docker login Deprecated In Release: v1.11 Target For Removal In Release: v1.13 The docker login command is removing the ability to automatically register for an account with the target registry if the given username doesn’t exist. Due to this change, the email flag is no longer required, and will be deprecated. Separator (:) of --security-opt flag on docker run Deprecated In Release: v

Environment file

Environment file Compose supports declaring default environment variables in an environment file named .env placed in the folder docker-compose command is executed from (current working directory). Compose expects each line in an env file to be in VAR=VAL format. Lines beginning with # (i.e. comments) are ignored, as are blank lines. Note: Values present in the environment at runtime will always override those defined inside the .env file. Similarly, values passed via command-line arguments ta

docker logs

logs Usage: docker logs [OPTIONS] CONTAINER Fetch the logs of a container -f, --follow Follow log output --help Print usage --since="" Show logs since timestamp -t, --timestamps Show timestamps --tail="all" Number of lines to show from the end of the logs Note: this command is available only for containers with json-file and journald logging drivers. The docker logs command batch-retrieves logs present at the ti

Using Compose with Swarm

Using Compose with Swarm Docker Compose and Docker Swarm aim to have full integration, meaning you can point a Compose app at a Swarm cluster and have it all just work as if you were using a single Docker host. The actual extent of integration depends on which version of the Compose file format you are using: If you’re using version 1 along with links, your app will work, but Swarm will schedule all containers on one host, because links between containers do not work across hosts with the old n