Fix link to requirements in Nginx recipe (#3969)
This commit is contained in:
parent
c6f6c44e56
commit
a59d321e8d
1 changed files with 91 additions and 101 deletions
|
@ -67,29 +67,22 @@ properly. For more information, see
|
|||
|
||||
## 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`:
|
||||
|
||||
```
|
||||
mkdir -p auth
|
||||
mkdir -p data
|
||||
```
|
||||
|
||||
Create the main nginx configuration you will use.
|
||||
|
||||
```
|
||||
|
||||
cat > auth/nginx.conf << 'EOF'
|
||||
events {
|
||||
```conf
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
}
|
||||
|
||||
http {
|
||||
http {
|
||||
|
||||
upstream docker-registry {
|
||||
server registry:5000;
|
||||
|
@ -147,28 +140,26 @@ http {
|
|||
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".
|
||||
|
||||
```
|
||||
docker run --rm --entrypoint htpasswd registry:2 -Bbn testuser testpassword > auth/nginx.htpasswd
|
||||
```
|
||||
```bash
|
||||
$ 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.
|
||||
|
||||
```
|
||||
cp domain.crt auth
|
||||
cp domain.key auth
|
||||
```
|
||||
```bash
|
||||
$ cp domain.crt 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`.
|
||||
|
||||
```
|
||||
cat <<EOF > docker-compose.yml
|
||||
nginx:
|
||||
```yaml
|
||||
nginx:
|
||||
image: "nginx:1.9"
|
||||
ports:
|
||||
- 5043:443
|
||||
|
@ -178,14 +169,13 @@ nginx:
|
|||
- ./auth:/etc/nginx/conf.d
|
||||
- ./auth/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
|
||||
registry:
|
||||
registry:
|
||||
image: registry:2
|
||||
ports:
|
||||
- 127.0.0.1:5000:5000
|
||||
volumes:
|
||||
- `pwd`./data:/var/lib/registry
|
||||
EOF
|
||||
```
|
||||
```
|
||||
|
||||
## Starting and stopping
|
||||
|
||||
|
|
Loading…
Reference in a new issue