From 277e6fc303a9cd0f9e424e3b94fdfab27dd2a1c9 Mon Sep 17 00:00:00 2001 From: Nicolas Favre-Felix Date: Fri, 22 Oct 2021 17:51:48 -0700 Subject: [PATCH] Update Dockerfile to build webdis with SSL support Two binaries are built and packaged: * /usr/local/bin/webdis -- still without SSL and does not depend on OpenSSL * /usr/local/bin/webdis-ssl -- supports SSL, depends on OpenSSL but has to be used with the webdis image as a base image or in a container injecting the webdis config and certs. --- Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e1234e8..6ddbeb4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,18 @@ FROM alpine:3.14.2 AS stage LABEL maintainer="Nicolas Favre-Felix " -RUN apk update && apk add wget make gcc libevent-dev msgpack-c-dev musl-dev bsd-compat-headers jq +RUN apk update && apk add wget make gcc libevent-dev msgpack-c-dev musl-dev openssl-dev bsd-compat-headers jq RUN wget -q https://api.github.com/repos/nicolasff/webdis/tags -O /dev/stdout | jq '.[] | .name' | head -1 | sed 's/"//g' > latest RUN wget https://github.com/nicolasff/webdis/archive/$(cat latest).tar.gz -O webdis-latest.tar.gz RUN tar -xvzf webdis-latest.tar.gz -RUN cd webdis-$(cat latest) && make && make install && cd .. +RUN cd webdis-$(cat latest) && make && make install && make clean && make SSL=1 && cp webdis /usr/local/bin/webdis-ssl && cd .. RUN sed -i -e 's/"daemonize":.*true,/"daemonize": false,/g' /etc/webdis.prod.json # main image FROM alpine:3.14.2 # Required dependencies, with versions fixing known security vulnerabilities -# RUN apk update && apk add libevent msgpack-c 'redis>5.1' 'apk-tools>2.12.6-r0' -RUN apk update && apk add libevent msgpack-c 'redis>6.2.6' 'apk-tools>2.12.6-r0' -COPY --from=stage /usr/local/bin/webdis /usr/local/bin/ +RUN apk update && apk add libevent msgpack-c 'redis>6.2.6' 'apk-tools>2.12.6-r0' 'openssl>=1.1.1l-r0' 'libssl1.1>=1.1.1l-r0' 'libcrypto1.1>=1.1.1l-r0' +COPY --from=stage /usr/local/bin/webdis /usr/local/bin/webdis-ssl /usr/local/bin/ COPY --from=stage /etc/webdis.prod.json /etc/webdis.prod.json RUN echo "daemonize yes" >> /etc/redis.conf CMD /usr/bin/redis-server /etc/redis.conf && /usr/local/bin/webdis /etc/webdis.prod.json