build
Build or rebuild services
--no-cache
Do not use cache when building the image.
help
Displays help and usage information on a command.
kill
Forces running containers to stop by sending a SIGKILL signal.
-s SIGNAL
SIGNAL to send to the container. Default signal is SIGKILL.
logs
View output from containers.
--no-color
Produce a monochrome output.
port
Print the public port for a port binding
--protocol=proto
Choose the 4th layer protocol, tcp or udp. Default is tcp.
--index=index
Index of the container if there are multiple instances of a service. Default is 1.
ps
List containers.
-q Only display IDs.
pull
Pulls service images from Docker registry.
--allow-insecure-ssl
Allow insecure connections to the Docker registry.
restart
Restart running containers.
-t, --timeoutTIMEOUT
Specify a shutdown timeout in seconds. Default is 10.
rm
Remove stopped service containers
-f, --force
Do not ask to confirm removal.
-v Remove volumes associated with containers.
run
Run a one-off command on a service. By default linked services will be started, unless they are already
running.
--allow-insecure-ssl
Allow insecure connections to the Docker registry.
-d Detached mode. Run container in the background, print new container name.
--entrypointCMD
Override the entrypoint of the image with CMD.
-e KEY=VAL
Set an environment variable. Can be used multiple times.
-u, --user=USER
Run as a specific USER, a username or uid.
--no-deps
Do not start linked services.
--rm Remove container after run. This option is ignored in the detached mode.
--service-ports
Run command with the service's ports enabled and mapped to the host.
-T Disable pseudo tty allocation. By default a tty is allocated.
scale
Set number of containers to run for a service. Numbers are specified in the form service=num as
arguments.
# docker-compose scale web=2 worker=3
start
Start existing containers.
stop
Stop running containers without removing them.
-t, --timeoutTIMEOUT
Specify a shutdown timeout in seconds. Default is 10.
up
Build, (re)create, start and attach to containers. If there are existing containers for a service,
`docker-compose up` will stop and recreate them (preserving mounted volumes with volumes-from), so that
changes in `docker-compose.yml` are picked up. If you do not want existing containers to be recreated,
`docker-compose up --no-recreate` will re-use existing containers.
--allow-insecure-ssl
Allow insecure connections to the Docker registry.
-d Detached mode. Run container in the background, print new container name.
--no-color
Produce a monochrome output.
--no-deps
Do not start linked services.
--x-smart-recreate
Only recreate containers whose configuration or image needs to be updated. This feature is
experimental.
--no-recreate
If containers already exist, do not recreate them.
--no-build
Do not build an image even if it is missing.
-t, --timeoutTIMEOUT
Specify a shutdown timeout in seconds. Default is 10.
migrate-to-labels
Recreate containers to add labels. If docker-compose detects containers that were created without labels,
it will refuse to run so that you don't end up with two sets of them.