7 months ago

Docker Basic Commands

These docker commands are that I use every single day

# 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 all images
docker rmi -f $(docker images -a -q)

Please let me know your other docker's daily hacks! 🥇

Do you have any comment on this tricks? then let the author know about that. comment here