Skip to content

Instantly share code, notes, and snippets.

@Fazzani
Last active December 21, 2019 23:51
Show Gist options
  • Save Fazzani/c1f764aad63bf10da906a28e4fba2481 to your computer and use it in GitHub Desktop.
Save Fazzani/c1f764aad63bf10da906a28e4fba2481 to your computer and use it in GitHub Desktop.
docker-compose
docker-compose start
docker-compose pause
docker-compose restart [options] [SERVICE...]
docker-compose stop [options] [SERVICE...]
Options:
-t, --timeout TIMEOUT Specify a shutdown timeout in seconds (default: 10).
docker-compose unpause
docker-compose ps
docker-compose up
docker-compose down
docker-compose up -d # start containers in background
docker-compose kill # stop containers
docker-compose up -d --build # force rebuild of Dockerfiles
docker-compose rm # remove stopped containers
docker ps # see list of running containers
docker exec -ti [NAME] bash # ssh to the container
# list all images
docker images
# tag and publishing
docker tag <id> buonzz/name:version
docker login
docker push buonzz/name
# delete image
docker rmi -f <id>
# run an image
docker run yourusername/docker-whale
# view logs
docker logs [OPTIONS] CONTAINER
# set the port to expose in host
docker run -p 3000 my_image
# start new container interactively
docker container run -it
###################### Prometheus ###########################
# To view all available command-line flags, run
./prometheus -h
# reload prometheus
curl -X POST http://eskimo.poliris.net:9090/-/reload
##################### Docker machine ###########################
#to switch to another machine
docker-machine use
#As a point of information, the config.json, certificates, and other data related to each virtual machine created by docker-machine is stored in
~/.docker/machine/machines/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment