Skip to content

Add templates and remove manual Lua install #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 30 additions & 10 deletions 1.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,50 @@
# vim:set ft=dockerfile:
FROM debian:jessie

RUN apt-get update && apt-get install -y libssl1.0.0 libpcre3 --no-install-recommends && rm -rf /var/lib/apt/lists/*
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libpcre3 \
libssl1.0.0 \
&& rm -rf /var/lib/apt/lists/*

ENV HAPROXY_MAJOR 1.5
ENV HAPROXY_VERSION 1.5.19
ENV HAPROXY_MD5 74d49316f00e1fd9859bcac84ab04b5c

# see https://sources.debian.net/src/haproxy/1.5.8-1/debian/rules/ for some helpful navigation of the possible "make" arguments
RUN buildDeps='ca-certificates curl gcc libc6-dev libpcre3-dev libssl-dev make' \
&& set -x \
# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments
RUN set -x \
\
&& buildDeps=' \
ca-certificates \
gcc \
libc6-dev \
libpcre3-dev \
libssl-dev \
make \
wget \
zlib1g-dev \
' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& curl -SL "https://www.haproxy.org/download/${HAPROXY_MAJOR}/src/haproxy-${HAPROXY_VERSION}.tar.gz" -o haproxy.tar.gz \
&& echo "${HAPROXY_MD5} haproxy.tar.gz" | md5sum -c \
\
&& wget -O haproxy.tar.gz "https://www.haproxy.org/download/${HAPROXY_MAJOR}/src/haproxy-${HAPROXY_VERSION}.tar.gz" \
&& echo "$HAPROXY_MD5 *haproxy.tar.gz" | md5sum -c \
&& mkdir -p /usr/src/haproxy \
&& tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1 \
&& rm haproxy.tar.gz \
&& make -C /usr/src/haproxy \
\
&& makeOpts=' \
TARGET=linux2628 \
USE_PCRE=1 PCREDIR= \
USE_OPENSSL=1 \
USE_PCRE=1 PCREDIR= \
USE_ZLIB=1 \
all \
install-bin \
' \
&& make -C /usr/src/haproxy -j "$(nproc)" all $makeOpts \
&& make -C /usr/src/haproxy install-bin $makeOpts \
\
&& mkdir -p /usr/local/etc/haproxy \
&& cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors \
&& rm -rf /usr/src/haproxy \
\
&& apt-get purge -y --auto-remove $buildDeps

COPY docker-entrypoint.sh /
Expand Down
31 changes: 20 additions & 11 deletions 1.5/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,46 @@
# vim:set ft=dockerfile:
FROM alpine:3.5

ENV HAPROXY_MAJOR 1.5
ENV HAPROXY_VERSION 1.5.19
ENV HAPROXY_MD5 74d49316f00e1fd9859bcac84ab04b5c

# see https://sources.debian.net/src/haproxy/1.5.8-1/debian/rules/ for some helpful navigation of the possible "make" arguments
# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments
RUN set -x \
\
&& apk add --no-cache --virtual .build-deps \
ca-certificates \
curl \
gcc \
libc-dev \
linux-headers \
make \
openssl \
openssl-dev \
pcre-dev \
readline-dev \
tar \
zlib-dev \
&& curl -SL "https://www.haproxy.org/download/${HAPROXY_MAJOR}/src/haproxy-${HAPROXY_VERSION}.tar.gz" -o haproxy.tar.gz \
&& echo "${HAPROXY_MD5} haproxy.tar.gz" | md5sum -c \
&& mkdir -p /usr/src \
&& tar -xzf haproxy.tar.gz -C /usr/src \
&& mv "/usr/src/haproxy-$HAPROXY_VERSION" /usr/src/haproxy \
\
# install HAProxy
&& wget -O haproxy.tar.gz "https://www.haproxy.org/download/${HAPROXY_MAJOR}/src/haproxy-${HAPROXY_VERSION}.tar.gz" \
&& echo "$HAPROXY_MD5 *haproxy.tar.gz" | md5sum -c \
&& mkdir -p /usr/src/haproxy \
&& tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1 \
&& rm haproxy.tar.gz \
&& make -C /usr/src/haproxy \
\
&& makeOpts=' \
TARGET=linux2628 \
USE_PCRE=1 PCREDIR= \
USE_OPENSSL=1 \
USE_PCRE=1 PCREDIR= \
USE_ZLIB=1 \
all \
install-bin \
' \
&& make -C /usr/src/haproxy -j "$(getconf _NPROCESSORS_ONLN)" all $makeOpts \
&& make -C /usr/src/haproxy install-bin $makeOpts \
\
&& mkdir -p /usr/local/etc/haproxy \
&& cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors \
&& rm -rf /usr/src/haproxy \
\
&& runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
| tr ',' '\n' \
Expand Down
2 changes: 2 additions & 0 deletions 1.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# vim:set ft=dockerfile:
FROM debian:jessie-backports

RUN apt-get update \
Expand All @@ -23,6 +24,7 @@ RUN set -x \
libssl-dev \
make \
wget \
zlib1g-dev \
' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
\
Expand Down
31 changes: 4 additions & 27 deletions 1.6/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
FROM alpine:3.5
# vim:set ft=dockerfile:
FROM alpine:3.7

ENV HAPROXY_MAJOR 1.6
ENV HAPROXY_VERSION 1.6.14
ENV HAPROXY_MD5 5daf73eb70052e8ec66c40817f265202

# https://www.lua.org/ftp/#source
ENV LUA_VERSION=5.3.4 \
LUA_SHA1=79790cfd40e09ba796b01a571d4d63b52b1cd950

# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments
RUN set -x \
\
Expand All @@ -16,6 +13,7 @@ RUN set -x \
gcc \
libc-dev \
linux-headers \
lua5.3-dev \
make \
openssl \
openssl-dev \
Expand All @@ -24,24 +22,6 @@ RUN set -x \
tar \
zlib-dev \
\
# install Lua
&& wget -O lua.tar.gz "https://www.lua.org/ftp/lua-$LUA_VERSION.tar.gz" \
&& echo "$LUA_SHA1 *lua.tar.gz" | sha1sum -c \
&& mkdir -p /usr/src/lua \
&& tar -xzf lua.tar.gz -C /usr/src/lua --strip-components=1 \
&& rm lua.tar.gz \
&& make -C /usr/src/lua -j "$(getconf _NPROCESSORS_ONLN)" linux \
&& make -C /usr/src/lua install \
# put things we don't care about into a "trash" directory for purging
INSTALL_BIN='/usr/src/lua/trash/bin' \
INSTALL_CMOD='/usr/src/lua/trash/cmod' \
INSTALL_LMOD='/usr/src/lua/trash/lmod' \
INSTALL_MAN='/usr/src/lua/trash/man' \
# ... and since it builds static by default, put those bits somewhere we can purge after we build haproxy
INSTALL_INC='/usr/local/lua-install/inc' \
INSTALL_LIB='/usr/local/lua-install/lib' \
&& rm -rf /usr/src/lua \
\
# install HAProxy
&& wget -O haproxy.tar.gz "https://www.haproxy.org/download/${HAPROXY_MAJOR}/src/haproxy-${HAPROXY_VERSION}.tar.gz" \
&& echo "$HAPROXY_MD5 *haproxy.tar.gz" | md5sum -c \
Expand All @@ -51,17 +31,14 @@ RUN set -x \
\
&& makeOpts=' \
TARGET=linux2628 \
USE_LUA=1 LUA_INC=/usr/local/lua-install/inc LUA_LIB=/usr/local/lua-install/lib \
USE_LUA=1 LUA_INC=/usr/include/lua5.3 LUA_LIB=/usr/lib/lua5.3 \
USE_OPENSSL=1 \
USE_PCRE=1 PCREDIR= \
USE_ZLIB=1 \
' \
&& make -C /usr/src/haproxy -j "$(getconf _NPROCESSORS_ONLN)" all $makeOpts \
&& make -C /usr/src/haproxy install-bin $makeOpts \
\
# purge the remnants of our static Lua
&& rm -rf /usr/local/lua-install \
\
&& mkdir -p /usr/local/etc/haproxy \
&& cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors \
&& rm -rf /usr/src/haproxy \
Expand Down
6 changes: 4 additions & 2 deletions 1.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM debian:jessie-backports
# vim:set ft=dockerfile:
FROM debian:stretch-slim

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
liblua5.3-0 \
libpcre3 \
libssl1.0.0 \
libssl1.1 \
&& rm -rf /var/lib/apt/lists/*

ENV HAPROXY_MAJOR 1.7
Expand All @@ -23,6 +24,7 @@ RUN set -x \
libssl-dev \
make \
wget \
zlib1g-dev \
' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
\
Expand Down
31 changes: 4 additions & 27 deletions 1.7/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
FROM alpine:3.5
# vim:set ft=dockerfile:
FROM alpine:3.7

ENV HAPROXY_MAJOR 1.7
ENV HAPROXY_VERSION 1.7.10
ENV HAPROXY_MD5 a9b98a228660dee5ee65b62e3bd57822

# https://www.lua.org/ftp/#source
ENV LUA_VERSION=5.3.4 \
LUA_SHA1=79790cfd40e09ba796b01a571d4d63b52b1cd950

# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments
RUN set -x \
\
Expand All @@ -16,6 +13,7 @@ RUN set -x \
gcc \
libc-dev \
linux-headers \
lua5.3-dev \
make \
openssl \
openssl-dev \
Expand All @@ -24,24 +22,6 @@ RUN set -x \
tar \
zlib-dev \
\
# install Lua
&& wget -O lua.tar.gz "https://www.lua.org/ftp/lua-$LUA_VERSION.tar.gz" \
&& echo "$LUA_SHA1 *lua.tar.gz" | sha1sum -c \
&& mkdir -p /usr/src/lua \
&& tar -xzf lua.tar.gz -C /usr/src/lua --strip-components=1 \
&& rm lua.tar.gz \
&& make -C /usr/src/lua -j "$(getconf _NPROCESSORS_ONLN)" linux \
&& make -C /usr/src/lua install \
# put things we don't care about into a "trash" directory for purging
INSTALL_BIN='/usr/src/lua/trash/bin' \
INSTALL_CMOD='/usr/src/lua/trash/cmod' \
INSTALL_LMOD='/usr/src/lua/trash/lmod' \
INSTALL_MAN='/usr/src/lua/trash/man' \
# ... and since it builds static by default, put those bits somewhere we can purge after we build haproxy
INSTALL_INC='/usr/local/lua-install/inc' \
INSTALL_LIB='/usr/local/lua-install/lib' \
&& rm -rf /usr/src/lua \
\
# install HAProxy
&& wget -O haproxy.tar.gz "https://www.haproxy.org/download/${HAPROXY_MAJOR}/src/haproxy-${HAPROXY_VERSION}.tar.gz" \
&& echo "$HAPROXY_MD5 *haproxy.tar.gz" | md5sum -c \
Expand All @@ -51,17 +31,14 @@ RUN set -x \
\
&& makeOpts=' \
TARGET=linux2628 \
USE_LUA=1 LUA_INC=/usr/local/lua-install/inc LUA_LIB=/usr/local/lua-install/lib \
USE_LUA=1 LUA_INC=/usr/include/lua5.3 LUA_LIB=/usr/lib/lua5.3 \
USE_OPENSSL=1 \
USE_PCRE=1 PCREDIR= \
USE_ZLIB=1 \
' \
&& make -C /usr/src/haproxy -j "$(getconf _NPROCESSORS_ONLN)" all $makeOpts \
&& make -C /usr/src/haproxy install-bin $makeOpts \
\
# purge the remnants of our static Lua
&& rm -rf /usr/local/lua-install \
\
&& mkdir -p /usr/local/etc/haproxy \
&& cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors \
&& rm -rf /usr/src/haproxy \
Expand Down
3 changes: 2 additions & 1 deletion 1.8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# vim:set ft=dockerfile:
FROM debian:stretch-slim

RUN apt-get update \
Expand All @@ -21,9 +22,9 @@ RUN set -x \
liblua5.3-dev \
libpcre3-dev \
libssl-dev \
zlib1g-dev \
make \
wget \
zlib1g-dev \
' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
\
Expand Down
31 changes: 4 additions & 27 deletions 1.8/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
FROM alpine:3.6
# vim:set ft=dockerfile:
FROM alpine:3.7

ENV HAPROXY_MAJOR 1.8
ENV HAPROXY_VERSION 1.8.8
ENV HAPROXY_MD5 8633b6e661169d2fc6a44d82a3aceae5

# https://www.lua.org/ftp/#source
ENV LUA_VERSION=5.3.4 \
LUA_SHA1=79790cfd40e09ba796b01a571d4d63b52b1cd950

# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments
RUN set -x \
\
Expand All @@ -16,6 +13,7 @@ RUN set -x \
gcc \
libc-dev \
linux-headers \
lua5.3-dev \
make \
openssl \
openssl-dev \
Expand All @@ -24,24 +22,6 @@ RUN set -x \
tar \
zlib-dev \
\
# install Lua
&& wget -O lua.tar.gz "https://www.lua.org/ftp/lua-$LUA_VERSION.tar.gz" \
&& echo "$LUA_SHA1 *lua.tar.gz" | sha1sum -c \
&& mkdir -p /usr/src/lua \
&& tar -xzf lua.tar.gz -C /usr/src/lua --strip-components=1 \
&& rm lua.tar.gz \
&& make -C /usr/src/lua -j "$(getconf _NPROCESSORS_ONLN)" linux \
&& make -C /usr/src/lua install \
# put things we don't care about into a "trash" directory for purging
INSTALL_BIN='/usr/src/lua/trash/bin' \
INSTALL_CMOD='/usr/src/lua/trash/cmod' \
INSTALL_LMOD='/usr/src/lua/trash/lmod' \
INSTALL_MAN='/usr/src/lua/trash/man' \
# ... and since it builds static by default, put those bits somewhere we can purge after we build haproxy
INSTALL_INC='/usr/local/lua-install/inc' \
INSTALL_LIB='/usr/local/lua-install/lib' \
&& rm -rf /usr/src/lua \
\
# install HAProxy
&& wget -O haproxy.tar.gz "https://www.haproxy.org/download/${HAPROXY_MAJOR}/src/haproxy-${HAPROXY_VERSION}.tar.gz" \
&& echo "$HAPROXY_MD5 *haproxy.tar.gz" | md5sum -c \
Expand All @@ -51,17 +31,14 @@ RUN set -x \
\
&& makeOpts=' \
TARGET=linux2628 \
USE_LUA=1 LUA_INC=/usr/local/lua-install/inc LUA_LIB=/usr/local/lua-install/lib \
USE_LUA=1 LUA_INC=/usr/include/lua5.3 LUA_LIB=/usr/lib/lua5.3 \
USE_OPENSSL=1 \
USE_PCRE=1 PCREDIR= \
USE_ZLIB=1 \
' \
&& make -C /usr/src/haproxy -j "$(getconf _NPROCESSORS_ONLN)" all $makeOpts \
&& make -C /usr/src/haproxy install-bin $makeOpts \
\
# purge the remnants of our static Lua
&& rm -rf /usr/local/lua-install \
\
&& mkdir -p /usr/local/etc/haproxy \
&& cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors \
&& rm -rf /usr/src/haproxy \
Expand Down
Loading