Skip to content

Instantly share code, notes, and snippets.

@absyah
Last active August 19, 2019 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save absyah/7c619ee8bce48e47af8cf4177d85908f to your computer and use it in GitHub Desktop.
Save absyah/7c619ee8bce48e47af8cf4177d85908f to your computer and use it in GitHub Desktop.
Learn Docker
# show containers
docker ps
# Logging to container
docker logs -f <container_id>
# ssh to container
docker exec -it <container_id> /bin/bash
# build container
docker-compose build [container_name_on_yml]
# run container
docker-compose up [container_name_on_yml]
# run rails console on container
docker-compose run <container_name_on_yml> rails c
# remove exited containers
docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs docker rm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment