🔧 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
Hi keshav Sandhu,
Top, very nice and helpful !
Thanks for sharing.
Thanks man
This is incredible.
The most used commands in docker.
Thank for Writing.
Thank you @keshav___dev
Great read. I would just suggest you to use Compose v2, which is without a hyphen:
docker compose up
.Recover shrinking disk space on every build :
dev.to/keshav___dev/prisma-recap-e...
Prisma cheat sheet
Super helpful! Thanks!
Great read, thank you 👍
Thank. Helpful
Helpful thank you!
helpful thanks
This is very helpful 😊
Very useful. :)
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/