Closed ukkopahis closed 2 years ago
Very good idea!
In the doco, I'm not really a fan of using docker-compose
when docker
will do the same/similar job. Two examples are ps
and logs
. The key problems I see with using docker-compose logs
are:
You either need to be in the ~/IOTstack
directory or pass the -f
argument pointing to the compose file. If neither of those is true then the user will get:
no configuration file provided: not found
whereas docker logs mosquitto
will always work.
If there's a reason for preferring docker-compose
in this situation that I'm just not seeing (too early in the morning) then I'd recommend using the established documentation pattern of always:
$ cd ~/IOTstack
$ docker-compose logs mosquitto
As far as I can see, docker-compose logs
just sticks the (colourised) container name on the front of each log line. My instant reaction was "serves no real purpose, adds to screen clutter, and increases wrap on narrower screens". Is there some benefit to that layout that I'm not seeing because I'm just not looking hard enough?
My reasoning for preferring docker-compose is to future-proof for a potential container_name
removal from all service templates.
But your points are valid, too. I'll add a third problem:
So yeah, docker vs docker-compose is a bit of a mess. Especially as using only docker-compose isn't sufficient in every situation.