Live data from Hacker News

Ask HN: What is the best source to learn Docker in 2023?

news.ycombinator.com

51–60 of 84 posts

Re: Ask HN: What is the best source to learn Docker in 2023?

#51

Step 0: Start with a device that "fully" supports docker. This is the reason I gave up on learning docker properly. I had 3 devices at my disposal - M1 mac, a windows 10 pc and a rpi. The random errors I was getting made me quite frustrated. Keep a code diary and document your mistakes and solutions. Also get a VPS. Never ever try a serverless solution when trying to properly learn docker. Also, do not try to do anyt…

Are you just recommending that they stay away from GPU processing while they learn or as a blanket suggestion? There are tons of images provided by Nvidia and framework/library authors that have the necessary drivers built in and make it trivial to run on a GPU.

Oh no, only while learning.

It all boil downs to that step 0, makes sure you have that "docker compatible" device. People are successfully running GPU processes using docker. However, docker is not "run everything, everywhere" as some people may think it is.

Really understanding the idea of containerization is fundamental. If someone tries to dabble in GPU processing in their first or second week of learning docker, they will be surprised how difficult troubleshooting docker is.

Re: Ask HN: What is the best source to learn Docker in 2023?

#52
post #23

I would start with understanding what containers are. Read up on what namespaces and cgroups are. Understand first what a container is, what it gives you and how Docker (vs other containerizers) fits into the picture. The first fundamental thing to understand is that containers are merely processes that have some sandboxing and perhaps limits applied to them, mem_cg, CFQ throttling, etc. Once you have that under your…

That's like someone asking how to learn C and you suggest starting with assembly.

It's the most roundabout way - and OP is conflating docker with CI/CD, referencing PHP and Node - it's probably safe to say they aren't looking for a deep dive.

Plus - knowing how it runs under the hood doesn't mean you know how to use docker itself.

Re: Ask HN: What is the best source to learn Docker in 2023?

#53
post #18

Earlier quoted context omitted.

Kubernetes and docker solve different problems. One is a container runtime, the other is a container orchestration tool. A mega-corp using Kubernetes can still use Docker, the two can work together. "Docker compose" (not the same thing as docker) works great at single machine scale/local development environments, but isn't really designed to scale much beyond this to production environments, multiple servers and data…

> "Docker compose" (not the same thing as docker) works great at single machine scale/local development environments, but isn't really designed to scale much beyond this to production environments, multiple servers and data centers etc, which Kubernetes is. This isn't to say you couldn't deploy something to production with compose, its just not very likely outside of small personal projects - there are heaps of featu…

I use swarm for smaller projects and am happy with it, though I know it's out of fashion now. I may try Nomad next time around. If I needed something more advanced or with more scale I am probably in a situation where a managed service would be within the budget.

Re: Ask HN: What is the best source to learn Docker in 2023?

#54
post #23

I would start with understanding what containers are. Read up on what namespaces and cgroups are. Understand first what a container is, what it gives you and how Docker (vs other containerizers) fits into the picture. The first fundamental thing to understand is that containers are merely processes that have some sandboxing and perhaps limits applied to them, mem_cg, CFQ throttling, etc. Once you have that under your…

That's like someone asking how to learn C and you suggest starting with assembly. It's the most roundabout way - and OP is conflating docker with CI/CD, referencing PHP and Node - it's probably safe to say they aren't looking for a deep dive. Plus - knowing how it runs under the hood doesn't mean you know how to use docker itself.

OP says they have used docker for a long time, and they want a deep dive.

I think it's safe to say they do want a deep dive but might be forgetting to mention some of their reasons.

For someone familiar with docker, maybe it is good to start from the other side and work backwards.

Re: Ask HN: What is the best source to learn Docker in 2023?

#55
post #24

ChatGPT. I’m not even joking, it’s now my first step in learning new tech (but not too new, GPT-3 was trained on a corpus ending in 2021 I believe) Ask it something like “Explain how to get started with Docker” and it will give you a bunch of steps in a reasonable order. Then ask it for details for each step, like: “How do I install Docker on macOS?” “Write a commented Dockerfile for an application written in $WHATEV…

OP is not actually asking how to learn Docker or a new technology. They are asking how to learn best practices for (the more complicated parts of) CI. Or maybe how to leverage docker at a higher level, than to go lower into the details of how it works.

What does ChatGPT say for something like

"How do I clean up old docker images in a registry after I merge a branch?"

Re: Ask HN: What is the best source to learn Docker in 2023?

#56
You're really asking about CI patterns and practices, which are not specific to Docker. The question is the same if using VMs.

You want to learn more about your CI system and then try things out until you hit the harder / edge cases.

Some things to try or think about

- Push two commits quickly, so the second starts while the first is running.

- rebuild a a commit while the current build is executing. Which one writes the final image to the registry? How do you know?

- How do you tag your images? If by branch name, how do you know which build produced an image? If by commit, how do you know which branch?

- Do you want to run the entire system per commit, shutting it down at the end of a build? Do you want to run supporting systems for the life of a branch? How do you clean up resources and not blow up your cloud budget? Do you clean up old containers each build (from old commits on this branch)? How do you clean up containers after a branch is deleted?

- Build a CI process that triggers subjobs, because eventually you may want to split things up. If you push a commit before the last build's subjob triggers, does it get the original commit or the latest commit? CI systems have nuances, Jenkins always fetches the latest commit when a job starts for a branch, so you may not be testing the code you think you are.

- Do you use a polyrepo or monorepo setup? For poly, how do you gather the right version of components for your commit? For mono, how do you build only what is necessary while still running a full integration test?

- Should you be doing integration testing inside or outside of the build system?

One of the reasons content that addresses these questions is harder to find is that the answers are highly dependent on the situation and tools. My solutions to many are handled with a mix of CUE and Python. You'll be writing code in most solutions

Re: Ask HN: What is the best source to learn Docker in 2023?

#58

Earlier quoted context omitted.

Are you just recommending that they stay away from GPU processing while they learn or as a blanket suggestion? There are tons of images provided by Nvidia and framework/library authors that have the necessary drivers built in and make it trivial to run on a GPU.

Oh no, only while learning. It all boil downs to that step 0, makes sure you have that "docker compatible" device. People are successfully running GPU processes using docker. However, docker is not "run everything, everywhere" as some people may think it is. Really understanding the idea of containerization is fundamental. If someone tries to dabble in GPU processing in their first or second week of learning docker,…

100% with you on that. There’s some many unintuitive things about just getting a container running if you’re doing anything beyond the hello world example!

Re: Ask HN: What is the best source to learn Docker in 2023?

#59
> I find it hard to find good and especially up to date tutorials.

It is even hard to find undoubtedly holistically good examples for docker usage. Many people do many things in different ways, some better some not so good. One can often find good aspects of docker usage in projects though. Like "What kind of environment variables should to let the user pass in, to avoid having to hardcode them in the image and keeping things configurable?", or "How to use multi-stage builds?". It is up to the thoughtful observer, to identify those and adapt ones own process of creating docker images.

I don't see docker as some kind of thing, that one sits down with for a few evenings and then fully knows. More like a thing one picks up over time. One runs into a problem, then searches for answers of how to solve this problem in a docker scenario, then finds several answers and picks one that seems appropriate, then learns, whether that choice was a good one later on. Until then it works for as long as that solution works. It is not like docker is some kind of scientific thing, where there is one correct answer to every question. Many things in docker are rather ad-hoc developed solutions to problems. Just look at the language that makes a docker file and you will see the ad-hoc-ness of it all. Then there are limitations that seem just as arbitrary. For example limited number of layers (stemming from being afraid of too much recursion not being supported by Go and not "externalizing the stack"), not being able to change most of a container's attributes (like labels) while the container is running.

As for questions of CI and so on: I think they are separate issues, which are solved by having a good workflow for the version control system of choice. One could for example configure the CI to do things for specific brances. Like deploying only the master branch or deploying a test branch to another machine/server. But this has nothing to do with docker.

Re: Ask HN: What is the best source to learn Docker in 2023?

#60
post #23

I would start with understanding what containers are. Read up on what namespaces and cgroups are. Understand first what a container is, what it gives you and how Docker (vs other containerizers) fits into the picture. The first fundamental thing to understand is that containers are merely processes that have some sandboxing and perhaps limits applied to them, mem_cg, CFQ throttling, etc. Once you have that under your…

That's like someone asking how to learn C and you suggest starting with assembly. It's the most roundabout way - and OP is conflating docker with CI/CD, referencing PHP and Node - it's probably safe to say they aren't looking for a deep dive. Plus - knowing how it runs under the hood doesn't mean you know how to use docker itself.

Unfortunately this is the right answer. Over the past few years many engineering organizations no longer value anything beyond surface level understanding of the technology used in their stacks.

You would think that is would still be advantageous to have a detailed understanding of what is going on in the stack, but that actually causes problems when you make a suggestion that no one else understands.

Post reply on HN