Skip to content
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

Add lua support. #38

Merged
merged 2 commits into from
Jan 19, 2017
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
42 changes: 31 additions & 11 deletions 1.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,50 @@
FROM debian:jessie
FROM debian:jessie-backports

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 \
liblua5.3-0 \
libpcre3 \
libssl1.0.0 \
&& rm -rf /var/lib/apt/lists/*

ENV HAPROXY_MAJOR 1.6
ENV HAPROXY_VERSION 1.6.11
ENV HAPROXY_MD5 844da4b553c887833550a008692e7a74

# see http://sources.debian.net/src/haproxy/1.5.8-1/debian/rules/ for some helpful navigation of the possible "make" arguments
RUN buildDeps='curl gcc libc6-dev libpcre3-dev libssl-dev make' \
&& set -x \
# see http://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments
RUN set -x \
\
&& buildDeps=' \
gcc \
libc6-dev \
liblua5.3-dev \
libpcre3-dev \
libssl-dev \
make \
wget \
' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& curl -SL "http://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 "http://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 \
\
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why this (I have seen it below too a few times). Is it for adding a white line? Did you know Dockerfile's white/comment lines are ignored?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we like to have some whitespace to separate sections of the RUN line. The Dockerfile parser does currently ignore empty lines, but it was "fixed" to not do so in moby/moby#24725 and reverted because of moby/moby#29005 in moby/moby#29064, but still planned to be deprecated with moby/moby#29161. As far as I know, comments in RUN lines will stay even if empty lines get removed.

&& makeOpts=' \
TARGET=linux2628 \
USE_PCRE=1 PCREDIR= \
USE_LUA=1 LUA_INC=/usr/include/lua5.3 \
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
57 changes: 46 additions & 11 deletions 1.6/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,68 @@ ENV HAPROXY_MAJOR 1.6
ENV HAPROXY_VERSION 1.6.11
ENV HAPROXY_MD5 844da4b553c887833550a008692e7a74

# see http://sources.debian.net/src/haproxy/1.5.8-1/debian/rules/ for some helpful navigation of the possible "make" arguments
# https://www.lua.org/ftp/#source
ENV LUA_VERSION=5.3.3 \
LUA_SHA1=a0341bc3d1415b814cc738b2ec01ae56045d64ef

# see http://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 \
curl \
ca-certificates \
gcc \
libc-dev \
linux-headers \
make \
openssl \
openssl-dev \
pcre-dev \
readline-dev \
tar \
zlib-dev \
&& curl -SL "http://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 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 "http://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_LUA=1 LUA_INC=/usr/local/lua-install/inc LUA_LIB=/usr/local/lua-install/lib \
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 \
\
# 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 \
\
&& runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
Expand Down
42 changes: 31 additions & 11 deletions 1.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,50 @@
FROM debian:jessie
FROM debian:jessie-backports

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 \
liblua5.3-0 \
libpcre3 \
libssl1.0.0 \
&& rm -rf /var/lib/apt/lists/*

ENV HAPROXY_MAJOR 1.7
ENV HAPROXY_VERSION 1.7.2
ENV HAPROXY_MD5 7330b36f3764ebe409e9305803dc30e2

# see http://sources.debian.net/src/haproxy/1.5.8-1/debian/rules/ for some helpful navigation of the possible "make" arguments
RUN buildDeps='curl gcc libc6-dev libpcre3-dev libssl-dev make' \
&& set -x \
# see http://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments
RUN set -x \
\
&& buildDeps=' \
gcc \
libc6-dev \
liblua5.3-dev \
libpcre3-dev \
libssl-dev \
make \
wget \
' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& curl -SL "http://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 "http://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_LUA=1 LUA_INC=/usr/include/lua5.3 \
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
57 changes: 46 additions & 11 deletions 1.7/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,68 @@ ENV HAPROXY_MAJOR 1.7
ENV HAPROXY_VERSION 1.7.2
ENV HAPROXY_MD5 7330b36f3764ebe409e9305803dc30e2

# see http://sources.debian.net/src/haproxy/1.5.8-1/debian/rules/ for some helpful navigation of the possible "make" arguments
# https://www.lua.org/ftp/#source
ENV LUA_VERSION=5.3.3 \
LUA_SHA1=a0341bc3d1415b814cc738b2ec01ae56045d64ef

# see http://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 \
curl \
ca-certificates \
gcc \
libc-dev \
linux-headers \
make \
openssl \
openssl-dev \
pcre-dev \
readline-dev \
tar \
zlib-dev \
&& curl -SL "http://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 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 "http://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_LUA=1 LUA_INC=/usr/local/lua-install/inc LUA_LIB=/usr/local/lua-install/lib \
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 \
\
# 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 \
\
&& runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
Expand Down