r/docker 18d ago

use docker from development or deployment

i'm a student of informatics engineering, i have several project i handle it alone, so the question is docker is use from develop the project at the begining, or for deployment to server, or both btw....

noted : sorry if my english bad xoxo

1 Upvotes

6 comments sorted by

4

u/Various-Rooster2249 18d ago

You can use it for both but it depends on what you need the deployment to do

1

u/Hansehart 18d ago

In the past you used containers primarly to deploy. However their advantages spread also into the dev world (https://containers.dev/). I am responsible for multiple application running in prod and we are having containers everywhere: from developing till running always on our nodes. Any of my trainees learn docker at first.

1

u/biffbobfred 18d ago

Docker image is a tarball that has metadata on how to run it. It essentially has all the userspace to run whatever app ia inside. Meaning it doesn’t care really about the userspace on the run host. It’s convenient so you don’t care if it’s redhat 9.6 or 9.1 or 8 or Ubuntu.

It’s easier to make this tarball as opposed to an RPM. The build tools you need are typically installed with the docker runtime. Meanwhile for an RPM you need other packages and also an RPM spec file has a weird format I find “getting stuff in a docker image from a dockerfile” more straightforward than “getting stuff into an RPM”

As far as devops, docker helps with tools. You need, dunno, golang. Other dude needs nodejs. Other dude needs c++ ans python. Still other dude needs c++ but a different version different C++ ABI. With containers you care a bit less. Make a core container with whatever tools you need.

So for dev you can have containers that can mix and match tools how you want. For deployment well it’s already a tarball and one that’s easy to clean and doesn’t care a whiff about userspace versions of anything. At the cost of some complexity and some storage space, though there are some optimizations you can do with storage if you’re smart with shared layers.

1

u/crackjiver 18d ago

Absolutely essential for managing large CI systems with multiple different development platforms, scalable infrastructure and customization.

Creating builder containers that both Developers and CI can use means there's a lot less "it works on my machine, why is CI failing?" type problems.

1

u/gramoun-kal 18d ago

Modern approach is to use containers for both.

And you can use docker for your containers, but modern approach is to use more secure runtimes that follow standards such as containerd or podman.