Live data from Hacker News

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

news.ycombinator.com

41–50 of 84 posts

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

#41
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…

I tried asking chatGPT some docker questions a couple of weeks ago, but beyond the very most basic "start an existing Debian container", the answers were always wrong unfortunately (I'm not a docker expert to see they are wrong, I ran them and they didn't work).

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

#43

I use Docker from time to time, but one question I have is more about workflow. How are people editing files within existing containers without resorting to one of the following: 1. Rebuilding the entire container which often involves stopping and starting it, etc. 2. Manually running commands that copy the files into the container. This is irritating because if I forget which files I changed or forget to run the cop…

Don't do 2 - use a bind mount instead!

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

#45

I use Docker from time to time, but one question I have is more about workflow. How are people editing files within existing containers without resorting to one of the following: 1. Rebuilding the entire container which often involves stopping and starting it, etc. 2. Manually running commands that copy the files into the container. This is irritating because if I forget which files I changed or forget to run the cop…

I generally put a Dockerfile.dev that creates a user with the same GID and UID as my own (injected through environment variables):

    RUN adduser -u $UID...
    USER node
Then in the docker-compose you bind mount your current directory.

    volumes:
      - ./:/app/

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

#46
The problems you describe have very little to do with docker itself, they sound more like integration challenges.

For example. Docker has absolutely zero knowledge of the branches lifetime or even branches at all. This is something you have to design using the existing capabilities of docker together with features or existing integrations provided by GitHub or bitbucket.

Of course knowing docker deeper will help you understand these boundaries better and use them.

One secret is that there is actually not much to it, most things are just variations of docker run and various tricks within docker build, sprinkled with some volume and image management like tagging and pruning. Other orchestrators like GH Actions, Compose, Kubernetes etc can be seen as building around these basic blocks.

If you already know these basics, you are probably going to learn faster by getting your hands dirty, trying to solve the scenarios you need, rather than binge watching tutorial#187 on YouTube.

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

#48
If your goal is to "learn Docker", I have around 100+ free blog posts and ad-free YouTube videos at: https://nickjanetakis.com/blog/tag/docker-tips-tricks-and-tu...

https://github.com/nickjj/docker-node-example is an up to date Node example app[0] that's ready to go for development and production and sets up GitHub Actions. Its readme links to a DockerCon talk from about a year ago that covers most of the patterns used in that project and if not some of my more recent blog posts cover the rest.

None of my posts cover feature branch deployments tho. That's a pretty different set of topics mostly unrelated to learning Docker. Implementing this also greatly depends on how you plan to deploy Docker. For example, are you using Docker Compose or Kubernetes, etc..

[0]: You can replace "node" in the GitHub URL with flask, rails, django and phoenix for other example apps in other tech stacks.

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

#49

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.
Post reply on HN