Fix link to requirements in Nginx recipe (#3969)

This commit is contained in:
Peter Kokot 2017-07-27 01:23:00 +02:00 committed by Misty Stanley-Jones
parent c6f6c44e56
commit a59d321e8d

View file

@ -67,29 +67,22 @@ properly. For more information, see
## Setting things up ## Setting things up
Read again [the requirements](index.md#requirements). Review the [requirements](../index.md#requirements), then follow ese steps.
Ready? 1. Create the required directories
-- ```bash
mkdir -p auth data
```
Create the required directories 2. Create the main nginx configuration you will use. Paste this code block into a new file called `auth/nginx.conf`:
``` ```conf
mkdir -p auth events {
mkdir -p data
```
Create the main nginx configuration you will use.
```
cat > auth/nginx.conf << 'EOF'
events {
worker_connections 1024; worker_connections 1024;
} }
http { http {
upstream docker-registry { upstream docker-registry {
server registry:5000; server registry:5000;
@ -147,28 +140,26 @@ http {
proxy_read_timeout 900; proxy_read_timeout 900;
} }
} }
} }
EOF ```
```
Now create a password file for "testuser" and "testpassword" 3. Create a password file `auth/nginx.htpasswd` for "testuser" and "testpassword".
``` ```bash
docker run --rm --entrypoint htpasswd registry:2 -Bbn testuser testpassword > auth/nginx.htpasswd $ docker run --rm --entrypoint htpasswd registry:2 -Bbn testuser testpassword > auth/nginx.htpasswd
``` ```
Copy over your certificate files 4. Copy your certificate files to the `auth/` directory.
``` ```bash
cp domain.crt auth $ cp domain.crt auth
cp domain.key auth $ cp domain.key auth
``` ```
Now create your compose file 5. Create the compose file. Paste the following YAML into a new file called `docker-compose.yml`.
``` ```yaml
cat <<EOF > docker-compose.yml nginx:
nginx:
image: "nginx:1.9" image: "nginx:1.9"
ports: ports:
- 5043:443 - 5043:443
@ -178,14 +169,13 @@ nginx:
- ./auth:/etc/nginx/conf.d - ./auth:/etc/nginx/conf.d
- ./auth/nginx.conf:/etc/nginx/nginx.conf:ro - ./auth/nginx.conf:/etc/nginx/nginx.conf:ro
registry: registry:
image: registry:2 image: registry:2
ports: ports:
- 127.0.0.1:5000:5000 - 127.0.0.1:5000:5000
volumes: volumes:
- `pwd`./data:/var/lib/registry - `pwd`./data:/var/lib/registry
EOF ```
```
## Starting and stopping ## Starting and stopping