August 2018
Intermediate to advanced
352 pages
12h 30m
English
We can even build images from a Dockerfile during the compose, and then use it for the app. For example, to build the WordPress image, we can use the corresponding Dockerfile and place it within the application compose directory:
$ cat DockerfileFROM wordpress:latest# extend the base wordpress image with anything custom# you might need for local dev.ENV CUSTOM_ENV env-value
We then need to update the docker-compose.yml file so that we are referencing the Dockerfile from above. This will allow us to change the WordPress image, and make any custom changes that we might need that are not in the official image:
$ cat docker-compose.ymlversion: "3.1"services: wordpress: build: . restart: always ports: - 8080:80 environment: ...
Read now
Unlock full access