

The Dockerfile needs more instructions to build out the application. At this point, you now have an image created, and running docker images will show you the images you have available: REPOSITORY TAG IMAGE ID CREATED SIZE With only one instruction in the Dockerfile, this doesn't do too much, but it does show you the build process without too much happening. Status: Downloaded newer image for node:7.7.2-alpine , you will see something similar to the following: Sending build context to Docker daemon 249.3 kBĭigest: sha256:6dcd183eaf2852dd8c1079642c04cc2d1f777e4b34f2a534cc0ad328a98d7f73 For more details about why I'm using alpine here over the other options, you can read this post. There are several choices, but this project uses the node:7.7.2-alpine image. The first instruction, FROM, will tell Docker to use the prebuilt NodeJS image. Open the newly created Dockerfile in your favorite editor. In the root directory of the application, create a new Dockerfile. You can set this up by installing NodeJS and all of its dependencies however the Docker ecosystem has an image repository (the Docker Store) with a NodeJS image already created and ready to use. The Dockerfile contains all of the instructions used to build out the application image. Creating the DockerfileĪt the foundation of any Dockerized application, you will find a Dockerfile. Once you have everything set up, you can move on to the next section. Some of the setup here is specific for this application, and the needs of your application may not be covered, but it should be a good starting point for you to get the concepts needed to Dockerize your own applications. The todo app here is essentially a stand-in, and you could replace it with your own application. This tutorial requires you to have a few items before you can get started.ĭownload Todo App Example - Non- Docker branch In this post, I will cover the first part: developing and testing with Docker Compose. In a two-part series, I will cover the development and pipeline creation steps. To provide an example of how you might move to containerized development, I built a simple todo API using NodeJS, Express, and PostgreSQL using Docker Compose for development, testing, and eventually in my CI/CD pipeline. It allows us to build and replicate images on any host, removing the inconsistencies of dev environments and reducing onboarding timelines considerably. Docker is an amazing tool for developers.
