Should I use Docker during development, deployment, or both?
Asked by
_borrowed binoculars
I'm an informatics engineering student working on several projects by myself. I'm trying to understand when Docker is most useful: should I introduce it at the beginning of development, use it only when deploying an application to a server, or use it throughout the entire development and deployment process?
Answers
You can use Docker for both development and deployment. The right choice depends on your project and what you need the deployment environment to handle.
Reply to this answer
Containers were originally used mostly for deployment, but theyโre very useful during development now too. Using the same container setup from development through production can make environments more consistent and reduce compatibility problems.
Reply to this answer
A Docker image packages an application together with the userspace and instructions needed to run it. That means the application is less dependent on whether the host uses one Linux distribution or another. Dockerfiles are also often simpler to maintain than traditional package specifications. During development, containers can provide isolated environments for tools such as Go, Node.js, Python, or different C++ versions. The tradeoff is some extra complexity and storage usage, although shared image layers can reduce that overhead.
Reply to this answer
For most modern projects, using containers in both stages is a practical approach. Docker is one option, although other standards-based runtimes and tools such as Podman or containerd may be preferable in some environments.
Reply to this answer
Containers are especially helpful for CI systems and teams working across different platforms. If developers and automated builds use the same builder container, there are fewer cases where something works locally but fails in CI.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions