r/docker • • Nov 20 '23

The Ultimate Docker Cheat Sheet

Hello Docker Community!
As a university lecturer, I know the importance of sharing knowledge. That's why I'm excited to share a comprehensive Docker Cheat Sheet that I've created. It is available as PDF and PNG. It's completely free, with no email signup or any other requirements.
This Cheat Sheet is part of my detailed blog post about Docker. Here is the link: https://devopscycle.com/blog/the-ultimate-docker-cheat-sheet/ It walks through the essentials of Docker, including Dockerfiles, images, and containers. You will also learn about accessing running containers and how to persist data. The post also includes a public GitHub repository. It comes with all the source code, available for anyone to use and learn from. It is an excellent entry point for an internal hackathon at your company or university.
If you like the blog post, the Docker Cheat Sheet or the GitHub repository, I would appreciate it if you share it. Your feedback and experiences are always welcome. Let's keep learning and growing together!
Cheers,
Mr_LA

129 Upvotes

16 comments sorted by

6

u/Stutturdreki Nov 20 '23

Nice.

I believe there is an error in the png under '# remove container', the png says 'docker stop <container-id>' while the blog correctly says 'docker rm <container-id>'.

Personally, I would suggest also running update & upgrade in your docker files. Had issues with security scanners when pushing and deploying docker files, even when using latest official images.

5

u/Mr_LA Nov 20 '23

Thank you, nice catch. I will update the cheat sheet.

Yes, that is true. I will run update the git repo and the blog post accordingly.

3

u/Mr_LA Nov 20 '23

The new versions are online

4

u/zoredache Nov 20 '23

Personally, I would suggest also running update & upgrade in your docker files.

While that might make your security people happy, that will have the downside of making your images non-reproducible.

A docker build today, could have a different set of software from a docker build of the same Dockerfile a week ago.

Some environments have a strong desire to have reproducible images, so they can get pretty much exactly the same image each time.

Ideally you would be using an upstream image that doesn't need updates, because it is really minimal or is frequently updated.

2

u/Cylon_Model-6 Nov 20 '23

Checks out.

Thank you.

1

u/Mr_LA Nov 20 '23

You are welcome.

2

u/root_switch Nov 21 '23

Nice work! Needs a little section for swarm :)

1

u/Mr_LA Nov 21 '23

Yep, the article would have gotten too long.

It's a good idea for a separate article and cheat sheet, maybe.

2

u/lgLindstrom Nov 21 '23

What about users and user permissions?

1

u/Mr_LA Nov 21 '23

What about users and user permissions

That is also important, but the article is already covering a lot. Could you please elaborate on what exactly you want to see?

3

u/lgLindstrom Nov 21 '23

As I understand containers running as root. This means that Volumes have files with root permissions which is messy when I am logged in as a user. I understand there is a way to handle this but I never understood how.

1

u/ofoxtrot Dec 11 '23

what's the font you are using there? I mean in the image with cheatsheet

1

u/Mr_LA Dec 11 '23

poppins for the headings, open sans for the paragraphs and IBM plex mono for the code

1

u/baljindersingh88 Jul 04 '24

u/Mr_LA Thank you the PDF sheet. It will be very helpful.

0

u/[deleted] Nov 20 '23

[deleted]

2

u/Mr_LA Nov 20 '23

Would love to hear from you, after you read it. Enjoy your tea :)