I’ve used Docker but know very few commands (my favorite command being “docker prune”, to clean up images on a machine). Here’s one I run into so I’m writing it down.
I had an image and I needed to verify what version of yarn was running in it.
docker run -it <image name>
Drops me into an interactive shell for that image. From there, I can run yarn version to see what’s up.
I would often get this advice:
docker exec <container name>
However, note that that’s for a container, not an image. It can be run on a running container. You can find those out by running docker ps or docker container list or docker container ls.