Public | Automated Build

Last pushed: 4 months ago
Short Description
Short description is empty for this repo.
Full Description

nginx-confd

This docker is usefull for using nginx with confd.
For examples please look at How To Use Confd and Etcd to Dynamically Reconfigure Services in CoreOS

Build image

docker build -t appunite/nginx-confd .

If building fail you can debug via where 1b372b1f76f2 is partial build

docker run --tty --interactive --rm 1b372b1f76f2 /bin/bash

Push build version to repository

docker push appunite/nginx-confd

Usage

Generate your certificates:

openssl genrsa -des3 -out www-server-withpass.key 2048 
openssl rsa -in www-server-withpass.key -out www-server.key
openssl req -new -key www-server.key -out www-server.csr
openssl x509 -req -days 365 -in www-server.csr -signkey www-server.key -out www-server.crt


openssl genrsa -des3 -out test-server-withpass.key 2048 
openssl rsa -in test-server-withpass.key -out test-server.key
openssl req -new -key test-server.key -out test-server.csr
openssl x509 -req -days 365 -in test-server.csr -signkey test-server.key -out test-server.crt

Configure your etcdctl:

etcdctl mkdir /services/nginx/www/
etcdctl mkdir /services/nginx/www/servers/
etcdctl set /services/nginx/www/root 'www.example.com'
cat www-server.crt | etcdctl set /services/nginx/www/ssl-crt
cat www-server.key | etcdctl set /services/nginx/www/ssl-key
etcdctl set /services/nginx/www/servers/1 '{"ip": "10.0.0.3", "port": "80"}'
etcdctl set /services/nginx/www/servers/2 '{"ip": "10.0.0.4", "port": "80"}'

etcdctl mkdir /services/nginx/test/
etcdctl mkdir /services/nginx/test/servers/
etcdctl set /services/nginx/test/root 'test.example.com'
cat test-server.crt | etcdctl set /services/nginx/test/ssl-crt
cat test-server.key | etcdctl set /services/nginx/test/ssl-key
etcdctl set /services/nginx/test/servers/1 '{"ip": "10.0.0.1", "port": "80"}'
etcdctl set /services/nginx/test/servers/2 '{"ip": "10.0.0.2", "port": "80"}'

Change directory to your project directory, than run:

docker run \
  --rm \
  --tty \
  --interactive \
  --name=nginx \
  --publish 80:80 \
  --publish 443:443 \
  appunite/nginx-confd

How you doin

Directories

For restricted basic auth access use

etcdctl set /services/nginx/test/restrict true
etcdctl mkdir /services/nginx/test/restrict-users
etcdctl set /services/nginx/test/restrict-users/root some_password
Docker Pull Command
Owner
appunite
Source Repository

Comments (0)