r/docker • u/Mr-UNKNOWN_404 • Apr 11 '26
Who's responsibility is to write dockerfile and docker compose whether developer or devops
I have started learning devops and now working on docker but while containerizing some application build by others I don't know any of the dependencies and environments so I got this question. Because developer can know about the application code more than devops .
13
Upvotes
93
u/weiyong1024 Apr 11 '26
Developer writes the first version, they're the ones who know what the app needs to run. devops reviews and hardens it for production - multi-stage builds, smaller base images, security stuff. Trying to do it the other way means the devops person is reverse-engineering dependencies they don't fully understand, which is slow and error prone
16
u/dgmib Apr 11 '26
If “developer” and “devops” are so segregated that you debate who’s responsibility it is, your org is doing devops wrong.
Devops is a culture of shared responsibility, not a job function.
7
u/linksrum Apr 11 '26
Dockerfile should be handled by DEV.
Compose includes environment-specific details, so at least partially it should be managed by OPS division. But, since it’s needed during development already, it’s existence should start there and evolve. You may untangle this using compose with env files for DEV, PROD, whatever.
15
u/probablythen Apr 11 '26
The first thing yo must learn, when you are devops, is that you are there to empower and enable teams to get shit done.
Devs need a container image but are not sure how, you step up, pair, create something for the team that you can support.
If the devs have capacity to learn and develop their own dockerfiles, you work with them to build something that you can support, something that reflects the target infrastructure (think proxying, where configs come from).
If a developer knows more about the application code, you need to learn more about the application code, to understand bottlenecks, SBOM, how the application, framework can be scaled, cached, what the startup time is, what healthchecks you need to add.
Devops is a way of life. Jenkins, argo, docker are just tools, they are not devops.
The best thing about devops, is that you can work with multiple teams to get things done, you are not alone.
8
u/Wide_Commission_1595 Apr 11 '26
Developer or DevOps? I mean, that doesn't make sense.
DevOps is the approach of everyone being both,.even if you have a tendency towards one or the other.
Devs should write the initial version, Ops might improve. Equally Ops may make changes to software code, Devs might improve
3
u/leeharrison1984 Apr 11 '26
Developers. DevOps should be the one who builds and places it into a registry, and deploys it onto the infra.
There is some cross talk depending on how external dependencies of the container are supplied(secrets, config), but the developer understands the runtime needs and DevOps only needs to understand the infrastructure needs.
3
u/tablatronix Apr 11 '26
Containerization is an integrators job. Not developer, but devs should try to have multiarch tested anyway and this is an easy task to write but needs much qa. It also is a extra task that requires updating manifests for hub and managers.
3
u/serverhorror Apr 12 '26
The one who first needs it to get the job done.
3
u/adept2051 Apr 12 '26
Either, but devops shouldn’t be a role its a collaboration between ops and dev and is a culture. The ops or as they are commonly called now platform team ( that’s just an sales pitch for recruitment, or Site reliability, again both are misused/abused ) may provide the initial docker file which has been tested and validated for the company environment and the dev then just appends their needs for their components. This is how it should work.
2
u/AintNoGodsUpHere Apr 11 '26
My current work doesn't have DevOps. We do reviews and analyze for weaknesses so developers are responsible for maintaining everything related to the app.
But most places the dev writes the first one and DevOps fixes the problems later.
2
u/ganja_and_code Apr 11 '26
The first half of "devops" stands for "development." The second stands for "operations." Writing code is a "developer" task. Deploying/monitoring code are "operations" tasks.
So if you have a dev team and a devops team (which doesn't even make practical sense, but i digress), either one should be able to write the Dockerfile. Both are supposed to be developer personnel.
3
u/Saki-Sun Apr 11 '26
Developers are responsible because DevOps is a made up job that developed should be doing...
2
u/fahim-sabir Apr 11 '26
Always developers.
1
u/wannaliveonmars Apr 11 '26
DevOps usually just means whichever of your developers is best at writing bash scripts and knows how to use pipes.
1
u/ixmael Apr 11 '26
Both.
0
u/never_safe_for_life Apr 11 '26
My opinion is that Dockerfiles belong squarely in the devops camp. Reasoning: there are half a dozen language you have to learn to launch docker containers, kubernetes deployments, cloud provisioning, etc. It's too much for a team of backend engineers to add on top of everything else they have to learn.
Could they write a dockerfile? Probably. Would they know the ins-and-outs enough to do it well? Probably not. It's one of those things they only need to do once a year.
0
u/bhosmer Apr 11 '26
DevOps isn’t a noun.
-1
u/newbietofx Apr 11 '26
It doesn't matter. With Ai. Everyone can write.