Skip to content

Commit 1bb9033

Browse files
committed
feat: Update NGINX App Protect docker build commands
This commit updates instances of docker build commands across the NGINX App Protect WAF & DoS documentation sets to append a platform parameter. Without it, Docker attempts to look for packages based on the architecture of the system you're building the image on.
1 parent be62861 commit 1bb9033

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

content/includes/nap-waf/build-nginx-image-cmd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ To build the image, execute the following command in the directory containing th
1010

1111

1212
```shell
13-
sudo docker build --no-cache \
13+
sudo docker build --no-cache --platform linux/amd64 \
1414
--secret id=nginx-crt,src=nginx-repo.crt \
1515
--secret id=nginx-key,src=nginx-repo.key \
1616
-t nginx-app-protect-5 .

content/nap-dos/deployment-guide/learn-about-deployment.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,7 @@ You need root permissions to execute the following steps.
14051405
6. Create a Docker image:
14061406
14071407
```shell
1408-
docker build --no-cache -t app-protect-dos .
1408+
docker build --no-cache --platform linux/amd64 -t app-protect-dos .
14091409
```
14101410
14111411
The `--no-cache` option tells Docker to build the image from scratch and ensures the installation of the latest version of NGINX Plus and NGINX App Protect DoS. If the Dockerfile was previously used to build an image without the `--no-cache` option, the new image uses versions from the previously built image from the Docker cache.
@@ -1966,13 +1966,13 @@ Make sure to replace upstream and proxy pass directives in this example with rel
19661966
For CentOS:
19671967
19681968
```shell
1969-
docker build --no-cache -t app-protect-dos .
1969+
docker build --no-cache --platform linux/amd64 -t app-protect-dos .
19701970
```
19711971
19721972
For RHEL:
19731973
19741974
```shell
1975-
docker build --build-arg RHEL_ORGANIZATION=${RHEL_ORGANIZATION} --build-arg RHEL_ACTIVATION_KEY=${RHEL_ACTIVATION_KEY} --no-cache -t app-protect-dos .
1975+
docker build --platform linux/amd64 --build-arg RHEL_ORGANIZATION=${RHEL_ORGANIZATION} --build-arg RHEL_ACTIVATION_KEY=${RHEL_ACTIVATION_KEY} --no-cache -t app-protect-dos .
19761976
```
19771977
19781978
The `--no-cache` option tells Docker to build the image from scratch and ensures the installation of the latest version of NGINX Plus and NGINX App Protect DoS. If the Dockerfile was previously used to build an image without the `--no-cache` option, the new image uses versions from the previously built image from the Docker cache.

content/nap-waf/v4/admin-guide/install.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ If a user other than **nginx** is to be used, note the following:
939939
- For Oracle Linux/Debian/Ubuntu/Alpine/Amazon Linux:
940940
941941
```shell
942-
DOCKER_BUILDKIT=1 docker build --no-cache --secret id=nginx-crt,src=nginx-repo.crt --secret id=nginx-key,src=nginx-repo.key -t app-protect .
942+
DOCKER_BUILDKIT=1 docker build --no-cache --platform linux/amd64 --secret id=nginx-crt,src=nginx-repo.crt --secret id=nginx-key,src=nginx-repo.key -t app-protect .
943943
```
944944
945945
The `DOCKER_BUILDKIT=1` enables `docker build` to recognize the `--secret` flag which allows the user to pass secret information to be used in the Dockerfile for building docker images in a safe way that will not end up stored in the final image. This is a recommended practice for the handling of the certificate and private key for NGINX repository access (`nginx-repo.crt` and `nginx-repo.key` files). More information [here](https://docs.docker.com/engine/reference/commandline/buildx_build/#secret).
@@ -1289,7 +1289,7 @@ You need root permissions to execute the following steps.
12891289
- For Oracle Linux/Debian/Ubuntu/Alpine/Amazon Linux:
12901290
12911291
```shell
1292-
DOCKER_BUILDKIT=1 docker build --no-cache --secret id=nginx-crt,src=nginx-repo.crt --secret id=nginx-key,src=nginx-repo.key -t app-protect-converter .
1292+
DOCKER_BUILDKIT=1 docker build --no-cache --platform linux/amd64 --secret id=nginx-crt,src=nginx-repo.crt --secret id=nginx-key,src=nginx-repo.key -t app-protect-converter .
12931293
```
12941294
12951295
The `DOCKER_BUILDKIT=1` enables `docker build` to recognize the `--secret` flag which allows the user to pass secret information to be used in the Dockerfile for building docker images in a safe way that will not end up stored in the final image. This is a recommended practice for the handling of the certificate and private key for NGINX repository access (`nginx-repo.crt` and `nginx-repo.key` files). More information [here](https://docs.docker.com/engine/reference/commandline/buildx_build/#secret).

0 commit comments

Comments
 (0)