image
What is image?
image: A read-only template containing your app, its dependencies, and a filesystem. You build an image once and run it as many containers. A Docker image is a read-only package containing your application, its dependencies and a file system. It is built from a Dockerfile, layer by layer, and can be run as many containers as you like.
Frequently asked questions about image
How is image used in practice?
Images are the unit you ship. CI builds an image, pushes it to a registry, and every environment runs that exact image. What you tested is what runs in production.
What should you keep in mind with image?
Keep images small and focused. Use multi-stage builds to leave build tools behind, a .dockerignore to keep junk out, and a slim base image. Tag images with something meaningful, such as the Git commit, and rebuild regularly to pick up security fixes in the base image. docker image prune cleans up old images that fill your disk over time.
What does an example of image look like?
docker build -t myapp:1.0 . docker images At a glance
| Category | Docker |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |