Merge ~valentinviennot/ubuntu-docker-images:update-nginx-readme into ~ubuntu-docker-images/ubuntu-docker-images/+git/nginx:edge

Proposed by Valentin Viennot
Status: Merged
Merged at revision: 618524d3dae23738d07a81ff90134c12f71f10a9
Proposed branch: ~valentinviennot/ubuntu-docker-images:update-nginx-readme
Merge into: ~ubuntu-docker-images/ubuntu-docker-images/+git/nginx:edge
Diff against target: 83 lines (+8/-41)
1 file modified
README.md (+8/-41)
Reviewer Review Type Date Requested Status
Sergio Durigan Junior Approve
Richard Harding Pending
Review via email: mp+393904@code.launchpad.net

Description of the change

Consistency and cleaning.

To post a comment you must log in.
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

LGTM. I will address my comment in a subsequent commit.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/README.md b/README.md
index 7e80594..e13e504 100644
--- a/README.md
+++ b/README.md
@@ -2,16 +2,12 @@
22
3## About Nginx3## About Nginx
44
5Nginx ("engine X") is a high-performance web and reverse proxy server created by Igor Sysoev. It can be used both as a standalone web server and as a proxy to reduce the load on back-end HTTP or mail servers.5Nginx ("engine X") is a high-performance web and reverse proxy server created by Igor Sysoev. It can be used both as a standalone web server and as a proxy to reduce the load on back-end HTTP or mail servers. Read more on the [nginx website](https://www.nginx.com/).
6
7Read more on the [nginx website](https://www.nginx.com/).
86
9## Tags7## Tags
108
11* `1.18.0-focal`, `1.18.0`, `1.18-focal`, `1.18`, `1-focal`, `1`, `focal`, `beta` - **/!\ this is a beta release**9* `1.18.0-focal`, `1.18.0`, `1.18-focal`, `1.18`, `1-focal`, `1`, `focal`, `beta` - **/!\ this is a beta release**
1210
13* `edge` = `1.18.0-0ubuntu1`
14
15## Architectures supported11## Architectures supported
1612
17* `amd64`, `arm64`, `ppc64el`, `s390x`13* `amd64`, `arm64`, `ppc64el`, `s390x`
@@ -21,8 +17,7 @@ Read more on the [nginx website](https://www.nginx.com/).
21### Docker CLI17### Docker CLI
2218
23```19```
24$ docker network create nginx-net --driver bridge20$ docker run -d --name nginx -p 8080:80 -e TZ=Europe/London squeakywheel/nginx:edge
25$ docker run -d --name nginx --network nginx-net -p 8080:80 -d squeakywheel/nginx:edge
26```21```
2722
28You can now point your browser to http://localhost:8080/ and verify23You can now point your browser to http://localhost:8080/ and verify
@@ -32,44 +27,16 @@ that it works.
3227
33| Parameter | Description |28| Parameter | Description |
34|---|---|29|---|---|
35| `-e TZ=UTC` | Timezone, e.g. `Europe/London` |30| `-e TZ=UTC` | Timezone. |
36| `-v /local/path/to/website:/var/www/html` | Mount and serve a local website |31| `-p 8080:80` | Expose Nginx on `localhost:8080`. |
37| `-v /my/config/nginx.conf:/etc/nginx/nginx.conf` | Mount a local configuration `nginx.conf` |32| `-v /path/to/website:/var/www/html` | Mount and serve a local website. |
3833| `-v /path/to/.template:/etc/nginx/templates/.template` | Mount template files inside `/etc/nginx/templates`. They will be processed and the results will be placed at `/etc/nginx/conf.d`. (e.g. `listen ${NGINX_PORT};` will generate `listen 80;`). |
39#### Environment variables inside nginx configuration34| `-v /my/config/nginx.conf:/etc/nginx/nginx.conf` | Mount a local configuration `nginx.conf` (download this [example file](https://git.launchpad.net/~canonical-server/ubuntu-server-oci/+git/nginx/plain/examples/config/nginx.conf)). |
40
41Nginx doesn't support environment variables inside most configuration blocks out-of-the-box, but this image is created in a way that makes this possible.
42
43You have to mount template files inside `/etc/nginx/templates`. They will be processed and the results will be placed at `/etc/nginx/conf.d`.
4435
45Consider this `docker-compose.yml`:
46
47```
48web:
49 image: squeakywheel/nginx:edge
50 volumes:
51 - ./templates:/etc/nginx/templates
52 ports:
53 - 8080:80
54 environment:
55 - NGINX_PORT=80
56```
57
58And this `templates/default.conf.template`:
59
60```
61listen ${NGINX_PORT};
62```
63
64If you mount `templates/default.conf.template` inside `/etc/nginx/templates`, it will generate a `/etc/nginx/conf.d/default.conf` like:
65
66```
67listen 80;
68```
6936
70#### Testing/Debugging37#### Testing/Debugging
7138
72In case you need to debug what it is happening with the container you can run `docker logs <name_of_the_container>`. But if you want to get access to an interactive shell run:39In case you need to debug what it is happening with the container you can run `docker logs <name_of_the_container>`. To get access to an interactive shell run:
7340
74```41```
75$ docker exec -it <name_of_the_container> /bin/bash42$ docker exec -it <name_of_the_container> /bin/bash

Subscribers

People subscribed via source and target branches