Docker packages an application and everything it needs into a container. A container runs the same way on your laptop, a test server and a cloud server, which is why DevOps teams use it so often.
Key terms
- Image: a template that describes the app and its setup.
- Container: a running copy of an image.
- Dockerfile: the text file that describes how to build an image.
Your first container
Install Docker, run a small image such as a web server, and open it in your browser. Then write a Dockerfile for a simple app you have already built, and run it as a container.
Common mistakes
- Building a very large image when a smaller base image would work.
- Storing passwords inside the image instead of passing them in when the container starts.
- Forgetting to map a port, so the app runs but cannot be reached.
Next step: see our cloud, AWS and DevOps course at ScholarLogic, or book a free demo class. A counsellor will share the fee and the next batch dates.
