Skip to content

Instantly share code, notes, and snippets.

@safizn
Last active January 25, 2017 22:04
Show Gist options
  • Save safizn/1758f26dbeadc3cac43c39d9f9167f10 to your computer and use it in GitHub Desktop.
Save safizn/1758f26dbeadc3cac43c39d9f9167f10 to your computer and use it in GitHub Desktop.
# DOCKER-COMPOSER
#installation
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-14-04
# https://docs.docker.com/compose/reference/overview/
docker-compose build -f X
docker-compose -f app.dockercompose.yaml build
# Build and run all services/containers in the docker-compose file.
docker-compose up
docker-compose -f app.dockercompose.yaml up -d
# run only one container:
docker-compose -f docker-compose.yml run -it <nameOfServiceInTheFile>
# Build compose
docker-compose -f ./setup/<docker-compose>.yml build <service>
# exit container bash shell using CTRL + P + Q
# check running composed containers
docker-compose ps
docker-compose logs
# list services by docker-compose file.
docker-compose -f <file> ps
# removes all services run by the docker-compose file.
docker-compose -f <file> down
# If run into any problems can use no cache option
--no-cache
# docker-compose
network-mode: host
# CMD
command: bash -c "sleep 100000"
# will be overridden by entrypoint.
# command: bash -c "tail -F -n0 /etc/hosts"
# use /bin/sh where bash is not installed (i.e. alpine-node image). Installed bash to the default image.
# command: bash -c ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment