FROM alpine:latest AS builder RUN apk add cargo RUN wget -O source.tar.gz \ $(wget -qO- https://api.github.com/repos/mbrubeck/agate/releases/latest \ | sed -nE 's/^.*"tarball_url"\s*:\s*"([^"]+)".*$/\1/p' \ ) \ && tar xzf source.tar.gz \ && mv /mbrubeck-agate-* /agate \ && cd agate \ && cargo build --release FROM alpine:latest RUN apk add --update --no-cache libgcc \ && mkdir -p /app/.certificates \ && mkdir /gmi \ && chown daemon:daemon /app/.certificates COPY --from=builder /agate/target/release/agate /usr/bin/agate COPY ./start.sh /app ENV LANG=en-US \ HOSTNAME=example.com VOLUME ["/app/.certificates", "/gmi"] EXPOSE 1965 USER daemon WORKDIR /app ENTRYPOINT ["/bin/sh", "start.sh"]