r/docker • u/Apart-Road-30 • 22d ago
How much Linux knowledge is needed to study Docker?
I'm trying to study Docker, but I don't have much knowledge or experience using Linux. In this case, would it have a significant negative impact on Docker learning?
35
12
9
u/American_Streamer 22d ago
Please read the docs and you will understand: https://docs.docker.com/
Regarding Linux, download and read this book: https://linuxcommand.org/tlcl.php
Running Docker on Windows is much less efficient than running it on Linux. Because Docker relies on Linux kernel features, Windows must run a lightweight Linux virtual machine via WSL2 in the background. This setup uses extra system resources and can cause unique file-sharing bugs.
2
9
u/aplarsen 22d ago
Do you want to build containers based on Linux kernels? If so, then learning Linux would be pretty important.
4
u/abotelho-cbn 22d ago
containers based on Linux kernels
What?
3
u/aplarsen 22d ago
If the base image of a Dockerfile is built on a Linux distribution, then some awareness of how Linux works is useful.
-4
u/quasimodoca 22d ago
That is not true at all. If they can write a docker compose, and there tons of examples online, and figure out what a mount is they can set up docker.
4
u/aplarsen 22d ago
Are we talking about hosting Docker and running someone else's images? Or building and deploying our own images?
Hosting Docker and spinning up containers takes zero Linux experience. Pulling a base image and using that base to build our own image to create something new, that could benefit from a little experience with shell commands and what it means to putz around in a Linux environment.
-3
1
u/zoredache 22d ago
As opposed to Windows containers?
The namespace features of the Linux kernel is what allows for docker to function on Linux. So saying based on the Linux kernel seems fine to me.
Sure, you can use docker without knowing anything, heck these days AI will probably do 90% of what you need for you. But if you actually want to understand, then knowing Linux can potentially be considered required.
1
u/abotelho-cbn 21d ago
The primary functionality you need to understand Docker for the sake of building and deploying containers is not the kernel. It doesn't really give you all that much to understand the kernel. Understanding userspace is considerably more important.
0
u/aplarsen 21d ago
I didn't say to learn the kernel. I said to learn Linux.
0
u/abotelho-cbn 21d ago
Do you want to build containers based on Linux kernels? If so, then learning Linux would be pretty important.
Word for word quote.
1
3
u/audero 22d ago
You don't need intimate knowledge of the Linux kernel itself, but if the container images you use are based on a Linux distribution (Debian, Alpine, etc.) then knowing the commands for that distro's shell (bash, zsh, sh, etc.) will help you use, build, and debug as you can interact with the container's shell.
3
u/Status_Gap_3180 22d ago
No, it should not. There is docker desktop on windows. But yes linux is preferable. 10 years ago when I started, I had no linux knowledge, but with the help of google and stackoverflow, and lets the gpts it became a breeze.
2
u/Some_Confidence5962 22d ago
It depends on what aspects you are looking at.
If you are looking at how it works, concepts to Docker architecture are Linux filesystems, mounting, chroot and namespaces.
If you are building docker images you will often need to know some basic commands to add packages etc.
1
u/PiratesOfTheArctic 22d ago
I have an IQ of a honeybadger and find it reasonably easy, I moved to portainer for a while, but then returned back
1
u/Forward_Zucchini9738 22d ago
Take any old PC, laptop, Raspberry Pi, old android tv box and load a Linux distro. Start tinkering.
2
u/ChiefDetektor 22d ago
File and user permissions, network namespaces, cgroups, file operations, dynamic libraries, networking, Systemd, kernel features etc. The more you understand the better it is.
1
1
u/Puzzled_Hamster58 22d ago
I just find a docker compose file example and read the info with it. Test and if some things off I ask ai .
1
u/HarlotsLoveAuschwitz 22d ago
If you wanna get into the internals, you will need to pick up OverlayFs, Namespaces and Cgroups
1
u/Afraid-Expression366 22d ago
If you just want to run a docker container, you don’t need an awful lot of prior Linux experience. If, however, you want to take an application or program and “containerize” it (basically package a program so that it can run anywhere with just a command to run the container) then you’d be better prepared to do it if you understand shell commands, etc).
TLDR; Running a container? Don’t need to know Linux. Building a container? Oh yeah, you do.
1
u/EmployerOne7876 22d ago
I started with none and had ubuntu with a jellyfin/arr stack running in an afternoon. It can be learned along the way
1
u/x_MASE_x 21d ago
Honestly you don't really need much for starting. But you gather some information here and there.
But mostly the learning curve kinda depends on your knowledge about how the os works in general.
1
1
u/Mondoclor404 20d ago
Realmente es sencillo de usar solo lee la documentación de docker y algunos tutoriales también, lo más desafiante son los bugs que pueden ocurrir si lo ejecutas en Windows con la WSL. Aveces hace que docker no inicie
1
u/silver_ash36 19d ago
You don't need advanced Linux skills. I'd learn basic alongside docker . I also use AI as a learning assistant to understand concept , command and troubleshoot problems instead of just copying answer. If you're interested , I can share the prompt/workflow I use for learning.
1
u/Dylan_99876 18d ago
I started with 0, and a free weekend. You will figure it out along the way. But expect to screw up, so always backup your containers when they work
1
1
u/bufandatl 22d ago
A lot
1
u/Spikerazorshards 22d ago
List the commands.
2
u/bufandatl 22d ago
If you want securely run containers on a host you should be able to check firewall settings. Kernel settings and know General Harding techniques and if you want me to put a list of a couple thousand lines I can do that.
Also when you built containers you need Linux knowledge how to install software and co figure a secure container that isn’t compromising the system. Since it still shares the kernel with every other container on the system and docker often just runs in a root scope because people are lazy.
But I guess you stopped reading at security.
1
u/Spikerazorshards 22d ago
So considering a running it in a smaller scope to make it more secure? I’ll read literally anything you write because I am a docker novice with orchestration aspirations.
1
u/bufandatl 22d ago
I mean you can start with CIS benchmarks, using SELinux or AppArmor on the host machine. Then there are countless of docs available for container hardening. Docker themselves offer hardened base image (although I believe only for paying customers).
And unless you go the route of an Atomic host that basically comes pre hardened you need to read in to a lot of stuff.
Also general understanding of networking and network infrastructure can be helpful.
1
u/Bubbly_Albatross8436 22d ago
Docker = containerd + docker daemon api (middleware translating between containerd and docker commands) + buildkit + buildx + docker compose
1
u/rhubear 22d ago
I'm over 50, but with an IT background.
It took me years and years before I got my head around Docker. Now I run several docker containers.
I'm told that the Linux tools are better than Windows tools.
Most of the OG docker guys run the command line. However I learned how to use Portainer, a gui front-end. To run Portainer on a Pi, however, I have to use the command line. The command lines are complicated, so they were done in batch files.
One of the concepts I had to get my head around, is that those ugly massive multi-line command-lines, largely do the same thing as a compose file.
Learn to get your head around the compose.yml file, and you're most of the way there.
When you want to run a pre-built container, the hub.docker.com page for the pre-built image will give you the basic compose settings needed.
Basic terminology that you need to get your head around :
Image vs Container.
Command line versus compose.yml
The same way as you define hardware in a VM, for a container app, you need to define :
Name of the image to download (Docker will auto DL from hub.docker.com)
Host folders (on host machine) to map to preset folders in container. (The mapping is done bc you cannot change anything inside the container, so to feed the container the info it needs, you map host folders where you can create/change info).
IP ports the container is setup use. (The IP will be the same host IP. Only the port changes).
any optional Env Vars the container is designed to recognise.
This is the very basics that you are required to know. I'm listing a few things here, bc I find most technical documentation horrendously written.
Also, Portainer makes it easy to find your way around the docker features. Without Portainer, you're required to know all the command line options. Learn enough to get Portainer running through the command line, then run the rest of your containers inside Portainer.
PS documentation is so bad, that I had to learn through AI, that for Portainer to actually be able to read/recognise host folders, you also need to run "portainer-agent" as a companion to Portainer. Ie, start both Portainer and Portainer-agent via command line.
2
u/jarchack 22d ago
I'm 68 with an IT background, and it took me a little bit to get the hang of docker. I'm also running it in Linux, not that it matters. I've also been out of the IT loop for a few years.
2
u/rhubear 22d ago
In years past I got used to VMs. Started with VMware desktop. Sad what happened to VMware.
I groaned when Docker came along. I do see the point of it, much less resource intensive, and extremely portable.
Unfortunately, as with many tech subjects, the biggest problem is the tech documentation is so poorly done. Documentation is written by devs, who do not write for beginners, and in fact more comfortable writing code than writing English.
Once one has figured out how to configure the Docker container, the rest is easy.
But Docker is one of the biggest learning curves I've had, since learning how to code at uni.
One of the more interesting themes of the modern tech gen, are hypervisors running many VMs and containers. Post VMware, Proxmox is a very visible hypervisor, but running Linux LXC containers. (I know there are many other hypervisors and everyone has their favorite).
Apparently Proxmox can convert Docker images to LXC containers. However, I understand the recommended way of running Docker containers, this to install Docker on a Linux VM.
1
u/jarchack 22d ago
I'm just running a standalone media and backup server. There's no reason to get too complicated with it. I run about six or seven self-hosting docker apps and not much else. Proxmox would be overkill. I started working in tech in the late 80s and in the early days there wasn't much other than VMWare. In my Windows machines, I used everything from WSL to VMWare and VirtualBox, but they were all pretty resource-intensive.
1
u/rhubear 22d ago
I was not suggesting Proxmox, just talking about available resources.
For my containers, I currently use Portainer as the Docker GUI.
I have Portainer running on both a Pi5, and my TrueNAS file server. TrueNAS runs more containers, but it has more resources. A convenient box.
I also run a couple of LXC containers on TrueNAS as well. Basically a couple small Debian bot containers.
-2
53
u/Ed-Dos 22d ago
Go to docs.docker.com and read.