Journal

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

Flow

  1. Add a Dockerfile to the project. E.g.: app/docker/Dockerfile.
  2. Build an image off of a Dockerfile. E.g.: run docker build....
  3. Create a new container from the image created above. E.g.: docker run...
  4. You can use the docker-compose command to run multi-container applications defined in the file docker-compose.yml. docker-compose up will start and run all the services defined in the docker-compose file.