carpentries-incubator / docker-introduction

Reproducible Computational Environments using Containers
https://carpentries-incubator.github.io/docker-introduction/
Other
42 stars 48 forks source link

Mix of 'old' and 'new' CLI commands #133

Closed mmalenta closed 2 years ago

mmalenta commented 2 years ago

There is a mix of old Docker CLI commands (e.g. docker run, docker build) and new commands (e.g. docker container ls) throughout the course. I was wondering whether it would be worth updating the course to follow the new, recommend and slightly less error-prone syntax. Additionally there could be a mention included at the start of the course, before the first docker command that the old commands still exists and to be aware of it for legacy code, but that the new syntax is preferred.

Additionally, places like Creating More Complex Container Images follow the old mount syntax -v ${PWD}:/temp, where the --mount type=,source=,target= syntax is recommended.

I know this involves going through the whole course and every single command, but if people think that this is something worth doing, I am happy to do it.

jcohen02 commented 2 years ago

Hi @mmalenta, thanks for highlighting this. I agree that adopting the newer command structure is probably a good idea. It does seem a little verbose and it also seems that, for now at least, the orginal commands will remain in place. However, as highlighted in the original v1.13 release notes when the CLI changes were introduced, it was encouraged that the new syntax is adopted.

In terms of the mount syntax, I again see the point about switching to mount and they do recommend in Docker's bind mount documentation that new users use the --mount option. I'm inclined to think that the -v option is much simpler than --mount but I suppose, as the docs point out, --mount is rather more explicit in highlighting what is being done (and more flexible for using other mount types).

I wouldn't be against these changes being made, but I do think that there should be callout boxes added highlighting the other "versions" of the commands. What do others think? @dme26 @sstevens2 @ChristinaLK @aturner-epcc?

aturner-epcc commented 2 years ago

@jcohen02 I agree. Using the newer syntax seems the right way to go but having callouts that highlight the old syntax that could still be in use quite widely would be required too.