diff --git a/Dockerfile b/Dockerfile index 45a09e3..049ddab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM nginx:1.14.1 +ARG BASE_IMAGE_TAG=1.14.1 +FROM nginx:$BASE_IMAGE_TAG LABEL maintainer="Jason Wilder mail@jasonwilder.com" # Install wget and install/updates certificates diff --git a/Dockerfile.alpine b/Dockerfile.alpine index 23459a3..2265dce 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -1,4 +1,5 @@ -FROM nginx:1.14.1-alpine +ARG BASE_IMAGE_TAG=1.14.1-alpine +FROM nginx:$BASE_IMAGE_TAG LABEL maintainer="Jason Wilder mail@jasonwilder.com" # Install wget and install/updates certificates diff --git a/README.md b/README.md index a6504cd..3162a94 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,24 @@ This image is based on the nginx:alpine image. Use this image to fully support H $ docker pull jwilder/nginx-proxy:alpine +### Custom base image + +nginx-proxy runs with the latest stable nginx. You can build your own image and choose a different base image tag (e.g `1.15.7` or `1.15.7-alpine`). + +``` +# debian +$ docker build --build-arg BASE_IMAGE_TAG=1.15 -t nginx-proxy-test-1.15 . +$ docker run --rm nginx-proxy-test-1.15 nginx -v +nginx version: nginx/1.15.7 + +# alpine +$ docker build --build-arg BASE_IMAGE_TAG=1.15-alpine -t nginx-proxy-test-1.15 -f Dockerfile.alpine . +$ docker run --rm nginx-proxy-test-1.15 nginx -v +nginx version: nginx/1.15.7 +``` + +For docker-compose see [docs.docker.com/compose/compose-file](https://docs.docker.com/compose/compose-file/#args). + ### Docker Compose ```yaml