Skip to content

Commit 316223d

Browse files
committed
update build
1 parent 6d21d38 commit 316223d

File tree

2 files changed

+10
-45
lines changed

2 files changed

+10
-45
lines changed

Dockerfile

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,53 @@
1-
FROM hyperknot/baseimage16:1.0.2
2-
3-
MAINTAINER friends@niiknow.org
4-
1+
FROM hyperknot/baseimage16:1.0.2 AS buildstep
52
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 \
63
TERM=xterm container=docker DEBIAN_FRONTEND=noninteractive \
4+
NGINX_DEVEL_KIT_VERSION=0.3.0 NGINX_SET_MISC_MODULE_VERSION=0.31 \
75
NGINX_VERSION=1.13.6
8-
9-
ENV NGINX_BUILD_DIR=/usr/src/nginx/nginx-${NGINX_VERSION} \
10-
NGINX_DEVEL_KIT_VERSION=0.3.0 NGINX_SET_MISC_MODULE_VERSION=0.31
11-
126
ADD ./build/src/ /tmp/
7+
RUN bash /tmp/ubuntu.sh
138

14-
RUN \
15-
cd /tmp \
16-
&& bash ubuntu.sh
179

18-
# build 2
1910
FROM hyperknot/baseimage16:1.0.2
2011

2112
MAINTAINER friends@niiknow.org
2213

23-
# files are nginx_***_adm64.deb or nginx-dbg_***_adm64.deb
24-
2514
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 \
2615
TERM=xterm container=docker DEBIAN_FRONTEND=noninteractive \
27-
NGINX_VERSION=1.13.6-1~xenial_amd64.deb
16+
NGINX_VERSION=_1.13.6-1~xenial_amd64.deb \
17+
NGINX_DEBUG=-dbg${NGINX_VERSION}
2818

29-
COPY --from=0 /usr/src/nginx/nginx_${NGINX_VERSION} /tmp
19+
COPY --from=buildstep /usr/src/nginx/nginx${NGINX_VERSION} /tmp
3020

31-
# start
32-
RUN \
33-
cd /tmp \
34-
35-
# increase ulimit
21+
RUN cd /tmp \
3622
&& echo "\n\n* soft nofile 800000\n* hard nofile 800000\n\n" >> /etc/security/limits.conf \
37-
38-
# add nginx repo
3923
&& curl -s https://nginx.org/keys/nginx_signing.key | apt-key add - \
4024
&& cp /etc/apt/sources.list /etc/apt/sources.list.bak \
4125
&& echo "deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | tee -a /etc/apt/sources.list \
4226
&& echo "deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | tee -a /etc/apt/sources.list \
43-
44-
# update repo
4527
&& apt-get update -y && apt-get upgrade -y --no-install-recommends --no-install-suggests \
4628
&& apt-get install -y --no-install-recommends --no-install-suggests \
4729
nano libgd3 gettext-base unzip rsync \
4830
&& dpkg --configure -a \
49-
50-
# install nginx
51-
&& dpkg -i nginx_${NGINX_VERSION} \
52-
53-
# && dpkg -i nginx-dbg_${NGINX_VERSION} \
54-
55-
# delete dummy conf
31+
&& dpkg -i nginx${NGINX_VERSION} \
5632
&& rm -rf /etc/nginx/conf.d/default.conf \
57-
58-
# re-enable all default services
5933
&& rm -f /etc/service/syslog-forwarder/down \
6034
&& rm -f /etc/service/cron/down \
6135
&& rm -f /etc/service/syslog-ng/down \
6236
&& rm -f /core \
63-
64-
# forward request and error logs to docker log collector
6537
&& ln -sf /dev/stdout /var/log/nginx/access.log \
6638
&& ln -sf /dev/stderr /var/log/nginx/error.log \
6739
&& service nginx stop && update-rc.d -f nginx disable \
68-
69-
# cleanup
7040
&& apt-get clean -y && apt-get autoclean -y \
7141
&& apt-get autoremove --purge -y \
7242
&& rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/*
7343

7444
ADD ./files /
7545

76-
RUN \
77-
# generate fake ssl for server conf, allow for replacing it later
78-
bash /root/bin/placeholder-ssl.sh \
46+
RUN bash /root/bin/placeholder-ssl.sh \
7947
&& mkdir -p /app-start/etc \
80-
81-
# redirect /etc/nginx
8248
&& mv /etc/nginx /app-start/etc/nginx \
8349
&& rm -rf /etc/nginx \
8450
&& ln -s /app/etc/nginx /etc/nginx \
85-
86-
# redirect logs
8751
&& mkdir -p /app-start/var/log \
8852
&& mv /var/log/nginx /app-start/var/log/nginx \
8953
&& rm -rf /var/log/nginx \

build/src/ubuntu.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22

3+
export NGINX_BUILD_DIR=/usr/src/nginx/nginx-${NGINX_VERSION}
34
cd /tmp
45

56
curl -sL "https://github.com/simpl/ngx_devel_kit/archive/v$NGINX_DEVEL_KIT_VERSION.tar.gz" -o dev-kit.tar.gz

0 commit comments

Comments
 (0)