Skip to content
Dockerfile 929 B
Newer Older
nimrod's avatar
nimrod committed
ARG Version="1.6.0"
ARG AlpineVersion="3.12"
nimrod's avatar
nimrod committed

FROM alpine:$AlpineVersion as builder
# hadolint ignore=DL3018
RUN apk add --update --no-cache \
    autoconf \
    automake \
    bison \
    build-base \
    flex \
    libev-dev \
nimrod's avatar
nimrod committed
    openssl-dev \
    py3-docutils \
    ;
nimrod's avatar
nimrod committed
ARG Version
ENV VERSION="$Version"
nimrod's avatar
nimrod committed
ADD "https://github.com/varnish/hitch/archive/${VERSION}.tar.gz" /
nimrod's avatar
nimrod committed
ENV LDFLAGS="--static"
nimrod's avatar
nimrod committed
RUN tar -xzf "${VERSION}.tar.gz" && \
    cd "hitch-${VERSION}" && \
    ./bootstrap && \
nimrod's avatar
nimrod committed
    ./configure && \
    make && \
    make install

FROM alpine:$AlpineVersion
# hadolint ignore=DL3018
RUN apk add --update --no-cache ca-certificates tini netcat-openbsd openssl
COPY --from=builder /usr/local/sbin/hitch /usr/local/sbin/
ARG Version
ENV VERSION="$Version"
RUN [ "$(hitch --version)" = "hitch $VERSION" ]
ENTRYPOINT ["tini", "--", "hitch"]
HEALTHCHECK CMD pgrep hitch || exit 1
LABEL Name="Hitch"
LABEL Version="${Version}"