Don't be Lazy use Containers

preview_player
Показать описание

💻 Github💻

🔥 Docker Links 🔥

💿 Music 💿
Song: Tokyo Music Walker - Slowly

0:00 The problem
0:20 Container buzz words
1:08 Why not a VM
1:32 Virtualization
3:21 The code
5:39 Demo

#programming #softwareengineering #coding
Рекомендации по теме
Комментарии
Автор

Nice video. Something that should be brought up is that sometimes containers don't "just work" on different machines for hardware related reasons. I had a case where everything worked in the development and testing environments, but it kept crashing on startup on an environment another company provided us. Long story short, they had given us access to a VM which didn't have AVX instructions available.

catnt
Автор

Please note that there are a lot of simplifications and some inaccuracies in this video.

The main benefit that containers provide compared to VMs is that they start much faster. There's also some overhead when VMs access hardware like the disk and networking. However, if you're running the VM directly on a hypervisor as opposed to inside your normal OS, then this overhead is relatively small. VMs on the other hand can run various operating systems, while containers run Linux inside a Linux host. (There are other options too, but this is the most common case.) If you want to run a Linux container on a MacOS or Windows host, the docker desktop actually runs a Linux Virtual Machine, and it runs the containers inside it. And this is an option even on Linux, if you need a different kernel for example.

The video seem to suggest to put many things inside the same container. E.g. Postgres and NGINX. This is generally considered a bad practice. Normally you'd put those two in separate containers and let them talk to each other. This allows you for example to scale the two parts independently and to reuse the same containers for different projects.

Speaking of scaling horizontally, the video mentions that as if it's something that is magically provided by the containers. They do help in this regard, but your application needs to be written appropriately. For example horizontally scaling SQL databases is hard. The DBMS needs to support it itself. You can't just make many copies of it, unless the DB is used only for reading.

You're saying (4:30 on) that the "COPY . ." copies the things installed by the previous command inside the image. This is not true. The "COPY . ." command copies the rest of the source code, pictures, etc. from your local folder to the container. It doesn't copy the things installed by "RUN npm install" as they are already installed inside the image.

Overall, to get the most out of containers one would need to understand their benefits and shortcomings and to design the application appropriately. Making it sound like they are better than they are only creates problems.

IvanToshkov
Автор

"works on my machine" ---- ok so we will ship your machine

i use nixOS btw

arbelarad
Автор

The whole point of the JVM is that you compile to it and it runs anywhere there's a JVM. I've never fully understood why people bother put spring apps in containers when they don't need the isolation

NexusGamingRadical
Автор

I prefere to use nix, because you can specify dependencies and tools that will be locally installed without virtualization.

But nice video anyway

polnio
Автор

Containers are NOT ALWAYS reproducible, so the "doesn't work on my machine" happens.
In the moment you use a `apt update` or similar you just lost you reproducibility altogether.
(The container has a different hash)

Nix is a better way to solve this issue and can be used with container.

Container is a way to isolate your environment and Nix resolves the problem of building the container image deterministically (yes also nix can be have reproducibility issues but it's basically the exception than the rule)

alexandrunechita
Автор

please make the video about kubernetes

dadecky
Автор

It worked on my machine.
We have the same container!
Virtualization software just casually stops working properly.

Автор

I know it’s not identical, but I had to deal with Python venvs for an API we had at my old job. One thing that we ran into quickly was that you couldn’t push the whole venv by default from the dev to prod servers. Turns out it defaulted to absolute paths for EVERYTHING. So if your python installs were in different places or were 0.0.1 version difference, it would break. Finding all those spots and fixing them was a pain in the butt. So we just only committed the actual code and had it populate INTO the venv on each server respectively

OctagonalSquare
Автор

can you talk about Test Driven Development and Game Programming?

Kitsune_Dev
Автор

What software do you use to make these videos?

hmmmza
Автор

4:32 when you are running npm install, where are you installing the packages? on you machine?

weeb
Автор

5:40 what are you running in the other tab with ffmpeg? are you recording this video lol

weeb
Автор

the next video needs to be about nix :D

otocotara
Автор

Me, when I start open source: "It works on my machine!"
My fellow contributor: "It doesn't on mine!"
Also me: *UNINSTALLS GITHUB*

twenty-fifth
Автор

_To err is human; to contain, divine_

ninetydirectory
Автор

how are you getting code completion in your command line? is it copiilot cli? trying to find a free or cheap alternative but couldn't for windows. idk why codexcli doesnt work

swapnilchand
Автор

OR you could just use a "nontrash" language with cross compilation and static linking.
This will ACTUALLY work on any machine.
WITHOUT any virtualization, container, vm, whatever else.

RichardLofty
Автор

What is your terminal setup? It’s gorgeous

meruzhansargsyan
Автор

Great now I have to make the containers work on my machine. Imagine spending weeks learning a system rather than just reading the instructions on the readme?

chudchadanstud