Building and pushing an application
We saw earlier that we can also use the docker-compose build
command to just build the images of an application defined in the underlying docker-compose
file. But to make this work, we’ll have to add the build information to the docker-compose
file:
- Open a new browser window and navigate to the chapter’s folder (
ch11
):$ cd ~/The-Ultimate-Docker-Container-Book/ch11
- Create a subfolder called
step3
and navigate to it:$ mkdir step3 && cd step3
- Copy the
docker-compose.yml
file from thestep2
folder to this new folder:$ cp ../step2/docker-compose.yml .
- Open the copied file and please note the
build
key for the web service on line 3 in the following screenshot. The value of that key indicates the context or folder where Docker is expecting to find the Dockerfile to build the corresponding image.
Figure 11.21 – The build key in the web service of the docker-compose.yml file
Please...