forked from opendns/nginx-auth-proxy
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
33 lines (26 loc) · 1.2 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM ubuntu:trusty
ENV DEBIAN_FRONTEND noninteractive
# nginx
RUN apt-get update -q \
&& apt-get install -yf build-essential python-software-properties software-properties-common \
&& add-apt-repository ppa:nginx/stable \
&& apt-get update -q \
&& apt-get -y install -y curl
# build nginx from source with http auth module enabled
RUN apt-get -y install libpcre3-dev zlib1g-dev libssl-dev
RUN curl -s http://nginx.org/download/nginx-1.6.2.tar.gz | tar -xz -C /tmp \
&& cd /tmp/nginx-1.6.2 \
&& ./configure --with-http_ssl_module --with-http_auth_request_module && make && make install
# put self signed ssl key (generated by htpasswd
# RUN apt-get -y install apache2-utils
ADD server.crt /etc/ssl/certs/docker-registry
ADD server.key /etc/ssl/private/docker-registry
# nginx configuration
# follow https://github.com/docker/docker-registry/tree/master/contrib/nginx
ADD nginx/nginx.conf /usr/local/nginx/conf/nginx.conf
ADD nginx/docker-registry.htpasswd /usr/local/nginx/conf/docker-registry.htpasswd
# ADD nginx/docker-registry.conf /usr/local/nginx/conf/docker-registry.conf
ADD nginx/nginx.default /usr/local/nginx/conf/sites-enabled/default
ADD start.sh /start.sh
EXPOSE 80 443
CMD /start.sh