From db63b76be69e12a0263c53556d88d232a84d1213 Mon Sep 17 00:00:00 2001 From: John Moon Date: Sun, 28 Jan 2024 10:41:29 -0800 Subject: [PATCH 1/2] nginx: Update command to generate host config file Currently, instructions to copy the default configuration from the nginx container to the host uses three commands. This can be done more efficiently with one command (assuming the presence of "cat" in the container which should be a safe). Update the instructions to use the single command. --- nginx/content.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nginx/content.md b/nginx/content.md index 805b97eae2d2..0c933763f5b7 100644 --- a/nginx/content.md +++ b/nginx/content.md @@ -42,9 +42,7 @@ You can mount your configuration file, or build a new image with it. If you wish to adapt the default configuration, use something like the following to get it from a running nginx container: ```console -$ docker run --name tmp-nginx-container -d %%IMAGE%% -$ docker cp tmp-nginx-container:/etc/nginx/nginx.conf /host/path/nginx.conf -$ docker rm -f tmp-nginx-container +$ docker run --rm --entrypoint=cat nginx /etc/nginx/nginx.conf > /host/path/nginx.conf ``` And then edit `/host/path/nginx.conf` in your host file system. From 387be298b208eafcffbe9994830dcf6d878aea17 Mon Sep 17 00:00:00 2001 From: John Moon Date: Wed, 31 Jan 2024 13:34:32 -0800 Subject: [PATCH 2/2] Update nginx/content.md Co-authored-by: Tianon Gravi --- nginx/content.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx/content.md b/nginx/content.md index 0c933763f5b7..47b01a4a218f 100644 --- a/nginx/content.md +++ b/nginx/content.md @@ -42,7 +42,7 @@ You can mount your configuration file, or build a new image with it. If you wish to adapt the default configuration, use something like the following to get it from a running nginx container: ```console -$ docker run --rm --entrypoint=cat nginx /etc/nginx/nginx.conf > /host/path/nginx.conf +$ docker run --rm --entrypoint=cat %%IMAGE%% /etc/nginx/nginx.conf > /host/path/nginx.conf ``` And then edit `/host/path/nginx.conf` in your host file system.