Strategies

Docker Swarm strategies The Docker Swarm scheduler features multiple strategies for ranking nodes. The strategy you choose determines how Swarm computes ranking. When you run a new container, Swarm chooses to place it on the node with the highest computed ranking for your chosen strategy. To choose a ranking strategy, pass the --strategy flag and a strategy value to the swarm manage command. Swarm currently supports these values: spread binpack random The spread and binpack strategies compute

docker run

run Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...] Run a command in a new container -a, --attach=[] Attach to STDIN, STDOUT or STDERR --add-host=[] Add a custom host-to-IP mapping (host:ip) --blkio-weight=0 Block IO weight (relative weight) --blkio-weight-device=[] Block IO weight (relative device weight, format: `DEVICE_NAME:WEIGHT`) --cpu-shares=0 CPU shares (relative weight) --cap-add=[] Add L

Swarm and container networks

Swarm and container networks Docker Swarm is fully compatible with Docker’s networking features. This includes the multi-host networking feature which allows creation of custom container networks that span multiple Docker hosts. Before using Swarm with a custom network, read through the conceptual information in Docker container networking. You should also have walked through the Get started with multi-host networking example. Create a custom network in a Swarm cluster Multi-host networks requi

docker-compose pause

pause Usage: pause [SERVICE...] Pauses running containers of a service. They can be unpaused with docker-compose unpause.

Getting Started

Getting Started On this page you build a simple Python web application running on Docker Compose. The application uses the Flask framework and increments a value in Redis. While the sample uses Python, the concepts demonstrated here should be understandable even if you’re not familiar with it. Prerequisites Make sure you have already installed both Docker Engine and Docker Compose. You don’t need to install Python, it is provided by a Docker image. Step 1: Setup Create a directory for the proj

Log tags for logging driver

Log Tags The tag log option specifies how to format a tag that identifies the container’s log messages. By default, the system uses the first 12 characters of the container id. To override this behavior, specify a tag option: docker run --log-driver=fluentd --log-opt fluentd-address=myhost.local:24224 --log-opt tag="mailer" Docker supports some special template markup you can use when specifying a tag’s value: Markup Description {{.ID}} The first 12 characters of the container id. {{.FullID}}

Dockerizing a Riak service

Dockerizing a Riak service The goal of this example is to show you how to build a Docker image with Riak pre-installed. Creating a Dockerfile Create an empty file called Dockerfile: $ touch Dockerfile Next, define the parent image you want to use to build your image on top of. We’ll use Ubuntu (tag: trusty), which is available on Docker Hub: # Riak # # VERSION 0.1.1 # Use the Ubuntu base image provided by dotCloud FROM ubuntu:trusty MAINTAINER Hector Castro hector@basho.com After that,

docker-machine ssh

ssh Log into or run a command on a machine using SSH. To login, just run docker-machine ssh machinename: $ docker-machine ssh dev ## . ## ## ## == ## ## ## ## === /""""""""""""""""\___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ \______ o __/ \ \ __/ \____\______/ _ _ ____ _ _ | |__ ___ ___ | |_|___ \ __| | ___

docker create

create Creates a new container. Usage: docker create [OPTIONS] IMAGE [COMMAND] [ARG...] Create a new container -a, --attach=[] Attach to STDIN, STDOUT or STDERR --add-host=[] Add a custom host-to-IP mapping (host:ip) --blkio-weight=0 Block IO weight (relative weight) --blkio-weight-device=[] Block IO weight (relative device weight, format: `DEVICE_NAME:WEIGHT`) --cpu-shares=0 CPU shares (relative weight) --cap-add=[]

docker-compose stop

stop Usage: stop [options] [SERVICE...] Options: -t, --timeout TIMEOUT Specify a shutdown timeout in seconds (default: 10). Stops running containers without removing them. They can be started again with docker-compose start.