Skip to content

Instantly share code, notes, and snippets.

@rkitover
Created September 30, 2022 01:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rkitover/e5fc15a19e678e1e17d89171db2e17c2 to your computer and use it in GitHub Desktop.
Save rkitover/e5fc15a19e678e1e17d89171db2e17c2 to your computer and use it in GitHub Desktop.
docker explanation
07-04 23:51 <Crocodillian> ok, so let me explain a bit
07-04 23:51 <Crocodillian> if you don't mind
07-04 23:51 <blank> Okay.
07-04 23:53 <Crocodillian> sorry had to pee
07-04 23:53 <Crocodillian> have you used chroots for anything before?
07-04 23:53 <Crocodillian> or bsd jails
07-04 23:54 <blank> Nope.
07-04 23:55 <Crocodillian> so a chroot is when you open a shell in a directory that becomes the whole linux system in that shell
07-04 23:55 <blank> Yes, I remember that much.
07-04 23:56 <Crocodillian> it still runs on the same kernel, but it's kind of analagous to a virtual machine
07-04 23:56 <Crocodillian> for example, you could be running ubuntu and open a chroot into a fedora system
07-04 23:57 <Crocodillian> then you could become users in that fedora system, run any apps from it, etc.
07-04 23:57 <blank> Okay.
07-04 23:58 <Crocodillian> so containers are kind of like that, and there is a whole infrastructure in the kernel now called OCI (Open Container Iniitiative)
07-04 23:58 <Crocodillian> this is what podman is an interface
07-04 23:59 <Crocodillian> podman is a command that works just like the docker command, except it uses OCI
07-04 23:59 <blank> Okay, so it's a chroot with a standard from the kernel.
07-05 00:00 <Crocodillian> yes, and many other things use containerization now too, for example flatpak uses ubuntu/etc. runtimes for apps
07-05 00:01 <Crocodillian> there is a lot more to it than just chroot, it can do virtual networking and such, but the chroot concept is the most important
07-05 00:01 <Crocodillian> now, why the fuck does anyone want this
07-05 00:01 <blank> Sure.
07-05 00:02 <Crocodillian> suppose you are packaging an app for deployment on linux servers or desktops
07-05 00:02 <Crocodillian> you make a container with ubuntu and all the shit you want
07-05 00:02 <Crocodillian> including your app
07-05 00:02 <Crocodillian> and then your users can bring it up in a few minutes instead of spending hours installing obscure packages or whatever the fuck
07-05 00:03 <Crocodillian> and because it's a container that runs on the same kernel, it's much much lighter weight than a vm, so you can have fucking thousands of these things
07-05 00:03 <Crocodillian> which is what people do with kubernetes
07-05 00:04 <Crocodillian> people often try to use alpine instead of ubuntu because it makes for a much smaller and lighter weight container
07-05 00:05 <Crocodillian> on docker hub there are thousands of packaged containers like, a whole mail system with postfix/imap/etc./etc./etc. that is configured by people who actually understand mail, which is very few people
07-05 00:06 <Crocodillian> so if you want to run a mail server, it makes much more sense to use one of those
07-05 00:06 <Crocodillian> or say you want a specific version of php or node or something, instead of spending hours trying to install or compile it in your distro, you just run the container in minutes or seconds
07-05 00:07 <Crocodillian> makes sense so far?
07-05 00:10 <blank> Yes.
07-05 00:10 <Crocodillian> ok, so there are also things like docker compose and kubernetes
07-05 00:10 <Ashy> KOOBIES
07-05 00:11 <Crocodillian> what they do is allow you to hook a bunch of containers together in a config using the container virtual networking
07-05 00:11 <Crocodillian> so like, you have your nginx, your php/node/whatever, your app, your database, your proxy, etc. etc. etc.
07-05 00:12 <Crocodillian> and you can bring all this shit up much much faster than if you had to do it manually, because it's all ready to go to just hook into your config
07-05 00:12 <blank> It's starting to sound less useful.
07-05 00:12 <blank> Web developers already don't know what they're doing.
07-05 00:12 <Crocodillian> yeah it's pure fucking cancer
07-05 00:13 <Crocodillian> but with kubernetes they can run literally hundreds of apps on a single machine
07-05 00:13 <Crocodillian> maybe thousands, I dunno
07-05 00:13 <Ashy> it's a side effect of nobody learning how to use their distro's package manager and systemd
07-05 00:14 <blank> I was in a meeting two weeks ago where I found out we're working with IT people who can't do simple things.
07-05 00:14 <blank> The IT people work in Big Pharmas. Think Genetech size.
07-05 00:14 <blank> They copy files by using a mouse because they don't know how to do it otherwise.
07-05 00:15 <Ashy> Too big to fail<C-w>pay-for-good-people
07-05 00:15 <blank> It's just the culture of not knowing how a package manager works.
07-05 00:17 <Crocodillian> oh, another very useful feature of docker/podman is that you can run shells in random distros/apps in seconds
07-05 00:18 <Crocodillian> I wrote this guide about this specifically: https://github.com/rkitover/docker-shell-guide
07-05 00:18 <plzbum> [ GitHub - rkitover/docker-shell-guide: Guide and Scripts for Running Shells in Docker Images ] - github.com
07-05 00:18 <blank> I have people that can barely keep a VM up and running.
07-05 00:18 <Crocodillian> it will also give you a very basic understanding of docker/podman, other than dockerfiles which you can read about elsewhere
07-05 00:19 <blank> I need to see someone else use it to solve a problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment