Re:Basic Docker Commands for Beginners
by pibefision on Friday April 24, 2020 @09:07AM
(#22967523)
I prefer Docker Compose to script all my docker tasks. It's easy, requires some understanding first (ie: environment variables) but after that you have reusable recipes.
[ Parent
| on HN ]
Shameless plug time! I made https://composerize.com/ for exactly this - converting all the docker run commands from tutorials and such into reusable compose files :)
This is actually one of my largest struggles with docker currently. Thanks for linking your tool!
Absolutely, one of the things I find very frustrating about Docker is that for the situations I need it it's never sufficient in itself, you still need to be mapping ports and volumes and setting variables- and that's all done in terminal commands which I have to remember or store somewhere and if I get something wrong it all falls apart. With docker-compose I've actually got a single file that I an use to make sure the container actually is reproducible. I'm willing to accept that maybe I just have weird requirements though.
I'm definitely not arguing about the advantages that docker-compose can bring (for me: readability & multiple containers easily connected), but aren't port mapping (-p) and env. variables (-e) and volumes (-v) simple with a docker command?
See https://docs.docker.com/engine/reference/commandline/run/