Last active
August 19, 2019 12:42
-
-
Save absyah/7c619ee8bce48e47af8cf4177d85908f to your computer and use it in GitHub Desktop.
Learn Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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