Docker packages an application together with everything it needs (runtime, libraries, settings) into an image. A running copy of an image is a container. Because the package is the same everywhere, the app behaves the same on your laptop, a test server and production.
Container vs virtual machine:
A virtual machine runs a complete guest operating system on top of virtualised hardware. It is heavy: gigabytes in size and slower to start.
A container shares the host's operating-system kernel and isolates only the process and its files. It is small (often megabytes) and starts in seconds.
A basic Dockerfile for a .NET app builds the project, copies the output into a runtime image and sets the start command. You then run docker build and docker run.
Containers are not a security boundary as strong as a VM, and they do not store data permanently by default. Use volumes for data you need to keep.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Docker packages an application together with everything it needs (runtime, libraries, settings) into an image. A running copy of an image is a container. Because the package is the same everywhere, the app behaves the same on your laptop, a test server and production.
Container vs virtual machine:
A basic Dockerfile for a .NET app builds the project, copies the output into a runtime image and sets the start command. You then run
docker buildanddocker run.Containers are not a security boundary as strong as a VM, and they do not store data permanently by default. Use volumes for data you need to keep.