Skip to content

Commit

Permalink
Try to use Alpine Linux as the base image
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLau committed Jul 16, 2016
1 parent 44de8dc commit 2b7ceea
Showing 1 changed file with 12 additions and 31 deletions.
43 changes: 12 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,24 @@
FROM debian:jessie
FROM alpine:3.4

# Install runtime packages
RUN apt-get update && apt-get install -y gnutls-bin iptables libev4 libnl-route-3-200 libprotobuf-c1 libseccomp2 libwrap0 openssl --no-install-recommends && rm -rf /var/lib/apt/lists/*

# NOT FOUND?
# libfreeradius-client-dev liblz4-dev libsystemd-daemon-dev
# Use included:
# libhttp-parser-dev libpcl1-dev libtalloc-dev
RUN apk update && apk add diffutils gawk gnutls gnutls-utils iptables libintl libnl linux-pam lz4 openssl readline sed

RUN buildDeps=" \
autoconf \
autogen \
ca-certificates \
curl \
g++ \
gcc \
gnutls-dev \
gperf \
libev-dev \
libgnutls28-dev \
libnl-route-3-dev \
libpam0g-dev \
libprotobuf-c-dev \
libreadline-dev \
libseccomp-dev \
libwrap0-dev \
gpgme \
linux-headers \
lz4-dev \
make \
pkg-config \
xz-utils \
readline-dev \
tar \
xz \
"; \
set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& LZ4_VERSION=`curl "https://github.com/Cyan4973/lz4/releases/latest" | sed -n 's/^.*tag\/\(.*\)".*/\1/p'` \
&& curl -SL "https://github.com/Cyan4973/lz4/archive/$LZ4_VERSION.tar.gz" -o lz4.tar.gz \
&& mkdir -p /usr/src/lz4 \
&& tar -xf lz4.tar.gz -C /usr/src/lz4 --strip-components=1 \
&& rm lz4.tar.gz \
&& cd /usr/src/lz4 \
&& make -j"$(nproc)" \
&& make install \
&& apk add $buildDeps \
&& OC_VERSION=`curl "http://www.infradead.org/ocserv/download.html" | sed -n 's/^.*version is <b>\(.*$\)/\1/p'` \
&& curl -SL "ftp://ftp.infradead.org/pub/ocserv/ocserv-$OC_VERSION.tar.xz" -o ocserv.tar.xz \
&& curl -SL "ftp://ftp.infradead.org/pub/ocserv/ocserv-$OC_VERSION.tar.xz.sig" -o ocserv.tar.xz.sig \
Expand All @@ -52,9 +34,8 @@ RUN buildDeps=" \
&& mkdir -p /etc/ocserv \
&& cp /usr/src/ocserv/doc/sample.config /etc/ocserv/ocserv.conf \
&& cd / \
&& rm -fr /usr/src/lz4 \
&& rm -fr /usr/src/ocserv \
&& apt-get purge -y --auto-remove $buildDeps
&& apk del $buildDeps

# Setup config
COPY cn-no-route.txt /tmp/
Expand Down

0 comments on commit 2b7ceea

Please sign in to comment.