Docker Newbie Notes
This year I worked on many projects that used Docker but I didn’t have a chance to set up the environments myself. In the last couple of weeks I had to dig a little deeper into Docker to set up an environment for a new project. Here’re my very (very) basic notes that I keept to hopefuly save me some time in future projects.
Most of Docker deals with two basic components images and containers. Images are static snapshots of an environment, which are layered making them lightweight. You edit a dockerfile to describe the steps to create an image. Containers are instances created from an image.
Useful Image commands
- Add a
Dockerfileto the project. E.g.:
- Build an image off of a
Dockerfile. E.g.: run
- Create a new container from the image created above. E.g.:
- You can use the
docker-composecommand to run multi-container applications defined in the file
docker-compose upwill start and run all the services defined in the docker-compose file.