A Bunch of Dockerfiles for NGINX Plus, NGINX App Protect and NGINX Instance Manager.
- Try NGINX Plus and NGINX App Protect: Just add licenses
- Try NGINX Instance Manager: Just add licenses
Run ./build-nginx-plus.sh [build_name]
, where [build_name]
one of:
[build_name] |
Description |
---|---|
alpine3.10 |
Alpine Linux 3.10 with NGINX Plus |
alpine3.10 |
Alpine Linux 3.10 with NGINX App Protect |
alpine3.11 |
Alpine Linux 3.11 with NGINX Plus |
alpine3.12 |
Alpine Linux 3.11 with NGINX Plus |
alpine3.12_tools |
Alpine Linux 3.12 with NGINX Plus and HTTP tools |
amazonlinux |
Amazon Linux with NGINX Plus |
amazonlinux2 |
Amazon Linux 2 with NGINX Plus |
amazonlinux2_controller |
|
centos7 |
Centos 7 (Latest) with NGINX Plus |
centos7.6 |
Centos 7.6 with NGINX Plus |
centos7.6_nap |
Centos 7.6 with NGINX App Protect |
centos7.6_nim |
Centos 7.6 with NGINX Instance Manager with NGINX plus |
centos7.6_controller |
|
centos8 |
Centos 8 with NGINX Plus |
rhel7 |
Red Hat (Universal Base) 7 (Latest) with NGINX Plus |
rhel7_nap |
Red Hat (Universal Base) 7 with NGINX App Protect |
rhel8 |
Red Hat (Universal Base) 8 with NGINX Plus |
rhel8_nim |
Red Hat (Universal Base) 8 with NGINX Instance Manager with NGINX plus |
debian9 |
Debian 9 with NGINX Plus |
debian9_nap |
Debian 9 with NGINX NGINX App Protect |
debian9_controller |
|
debian10 |
Debian 10 with NGINX Plus |
debian10_nap |
Debian 10 with NGINX App Protect |
debian10_nim |
Debian 10 with NGINX Instance Manager with NGINX plus |
oracle7 |
Oracle Linux 7 (Latest) with NGINX Plus |
ubuntu18.04 |
Ubuntu 18.04 with NGINX Plus |
ubuntu18.04_controller |
|
ubuntu18.04_crossplane |
Ubuntu 18.04 with NGINX Plus and Crossplane |
ubuntu18.04_nap |
Ubuntu 18.04 with NGINX App Protect |
ubuntu20.04 |
Ubuntu 20.04 with NGINX Plus |
ubuntu20.04_nim |
Ubuntu 20.04 with NGINX Instance Manager with NGINX plus |
-
Prepare your NGINX license files in the correct build directories:
- For NGINX Plus and NGINX App Protect: Copy your
nginx-repo.crt
andnginx-repo.key
intoetc/ssl/nginx
directory - For NGINX Instance Manager and NGINX App Protect: Copy your
nginx-repo.crt
andnginx-repo.key
intoetc/ssl/nginx
directory, Additionally, Copy yourNGINX-Instance-Manager.lic
(may be named differently) into the/etc/nginx-manager/
directory. It is referenced by thelicense:
option in the/etc/nginx-manager/nginx-manager.conf
file, and has already been set in the file provided in this repo
- For NGINX Plus and NGINX App Protect: Copy your
-
Build an image from your Dockerfile:
# ./build-nginx-plus.sh [Build-name] $ ./build-nginx-plus.sh ubuntu18.04_nap
-
See the Docker images available
# NGINX PLUS images are named nginx-plus-[build] $ docker images | grep nginx-plus # NGINX App Protect images are named nginx-app-protect-[build] $ docker images | grep nginx-app-protect # NGINX Instance Manager images are named nginx-nim-[build] $ docker images | grep nginx-nim # NGINX PLUS with Controller Agent images are named nginx-agent-[build] $ docker images | grep nginx-agent
- Prepare your NGINX license files in the correct build directories:
- For NGINX Plus and NGINX App Protect: Copy your
nginx-repo.crt
andnginx-repo.key
intoetc/ssl/nginx
directory - For NGINX Instance Manager and NGINX App Protect: Copy your
nginx-repo.crt
andnginx-repo.key
intoetc/ssl/nginx
directory, Additionally, Copy yourNGINX-Instance-Manager.lic
(may be named differently) into the/etc/nginx-manager/
directory. It is referenced by thelicense:
option in the/etc/nginx-manager/nginx-manager.conf
file, and has already been set in the file provided in this repo
- For NGINX Plus and NGINX App Protect: Copy your
- Copy the desired
Dockerfile
into the correct build folder:NGINX-PLUS
- NGINX Plus onlyNAP
- NGINX App ProtectNIM
- NGINX Instance Manager with NGINX Plus
- Build an image from your Dockerfile:
# Run command from the folder containing the `Dockerfile` # docker build -t [docker_image_name] . $ docker build -t nginx-plus .
-
Start the container, e.g.:
# e.g. NGINX Plus, NGINX App Protect # Start a new container and publish container ports 80, 443 and 8080 to the host # Where [docker_image_name] is found on the last step $ docker run -d -p 80:80 -p 443:443 -p 8080:8080 [docker_image_name] # e.g. NGINX Instance Manager # Start a new container and publish container ports 80, 443, 8080 and 10002 to the host # Where [docker_image_name] is found on the last step $ docker run -d -p 80:80 -p 443:443 -p 8080:8080 -p 10002:10002 [docker_image_name]
-
Optional: Mount local volume:
docker run -d \ -p 80:80 -p 443:443 \ -p 8080:8080 \ -v $PWD/etc/nginx:/etc/nginx [docker_image_name]
-
To run commands in the docker container you first need to start a bash session inside the nginx container
# get Docker IDs of running containers docker ps # Enter a Alpine Linux BusyBox shell sudo docker exec -i -t [CONTAINER ID] /bin/sh # OR # Enter a Linux Bash shell sudo docker exec -i -t [CONTAINER ID] /bin/bash
-
To open logs
# get Docker IDs of running containers docker ps # View and follow container logs sudo docker logs -f [CONTAINER ID]
- See todo