Update Dockerfile to no longer require the latest tag

The Dockerfile used to refer to the latest published tag for Webdis.
This meant updating the file every time a new release was published.
This change uses the GitHub API to find the latest tag before
downloading and building the corresponding release.
master
Nicolas Favre-Felix 4 years ago
parent 64d545cd64
commit a41bd55105

@ -1,10 +1,11 @@
FROM alpine:3.11.3 AS stage
MAINTAINER Nicolas Favre-Felix <n.favrefelix@gmail.com>
RUN apk update && apk add wget make gcc libevent-dev msgpack-c-dev musl-dev bsd-compat-headers
RUN wget https://github.com/nicolasff/webdis/archive/0.1.10.tar.gz -O webdis-0.1.10.tar.gz
RUN tar -xvzf webdis-0.1.10.tar.gz
RUN cd webdis-0.1.10 && make && make install && cd ..
RUN apk update && apk add wget make gcc libevent-dev msgpack-c-dev musl-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 sed -i -e 's/"daemonize":.*true,/"daemonize": false,/g' /etc/webdis.prod.json
# main image

Loading…
Cancel
Save