🔧 Common Docker Commands
Start Docker:
systemctl start docker # Linux
open -a Docker # macOS
Enter fullscreen mode
...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
You can also make a helper script:
New file at the root folder called
dc
without extension.Content example. Modify for your needs.
Give execute permission with
chmod +x ./dc
And now you can run:
./dc
to show all containers with status./dc up
to start in detached mode./dc install
to run npm install in the node container as user node./dc npm install package-name-here
to run any npm command inside node container. Works with./dc npm run start
too./dc nr
interactive exec inside node container./dc nr node index.js
run any command inside node container./dc recreate
applies any modifications to docker-compose.yml./dc recreate node
applies modifications to compose, only for node container./dc build
if you have a custom dockerfile, does run dc up with a fresh build../dc logs -n 10 -f node
- any other docker-compose command works as expected.Adding one more
docker system prune
This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- unused build cache
This is awesome! Instantly added to github.com/devmount/CheatSheets
Thank you!
@devmount Your Github profile is super cool, bro. Much to learn
Thank you so much 🤗
Thanks!!
The most used commands in docker.
Thank for Writing.
Thank you @keshav___dev
Hi keshav Sandhu,
Top, very nice and helpful !
Thanks for sharing.
Excellent article, thank you! 💯
Something that made me smile, you can tell that the banner image was created using AI :D
If service is there, why not use it 😉
Thanks man
This is incredible.
dev.to/keshav___dev/prisma-recap-e...
Prisma cheat sheet
helpful thanks
Recover shrinking disk space on every build :
Great read. I would just suggest you to use Compose v2, which is without a hyphen:
docker compose up
.Thank. Helpful
Helpful thank you!
Very useful. :)
This is very helpful 😊
Great read, thank you 👍
Super helpful! Thanks!
Hamen krna kiah
Can I get PDF of this ..?
Hi there. as a mern stack developer, i launched my first web. Feel free to submit your feedback if it needs improving
codelabs.uz/