refactor: docker images to use new binary source

This commit is contained in:
Jose Quintana
2021-06-22 23:14:07 +02:00
parent ec5a11a486
commit 6fe04a5eaf
2 changed files with 12 additions and 9 deletions

View File

@@ -9,18 +9,17 @@ LABEL version="${SERVER_VERSION}" \
RUN apk --no-cache add ca-certificates tzdata
RUN set -ex; \
apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
armhf) arch='armv6' ;; \
aarch64) arch='arm64' ;; \
x86_64) arch='amd64' ;; \
*) echo >&2 "error: unsupported architecture: $apkArch"; exit 1 ;; \
esac;
wget --quiet -O /tmp/static-web-server.tar.gz "https://github.com/joseluisq/static-web-server/releases/download/v$SERVER_VERSION/static-web-server-v$SERVER_VERSION-x86_64-unknown-linux-musl.tar.gz"; \
tar xzvf /tmp/static-web-server.tar.gz; \
cp static-web-server-v${SERVER_VERSION}-x86_64-unknown-linux-musl/static-web-server /usr/local/bin/; \
rm -rf /tmp/static-web-server.tar.gz static-web-server-v${SERVER_VERSION}-x86_64-unknown-linux-musl; \
chmod +x /usr/local/bin/static-web-server
COPY ./docker/alpine/entrypoint.sh /
COPY ./bin/static-web-server /usr/local/bin/
COPY ./public /public
EXPOSE 80
VOLUME ["/public"]
ENTRYPOINT ["/entrypoint.sh"]
CMD ["static-web-server"]

View File

@@ -1,3 +1,7 @@
ARG SERVER_VERSION=0.0.0
FROM joseluisq/static-web-server:${SERVER_VERSION}-alpine AS latest
FROM scratch
ARG SERVER_VERSION=0.0.0
@@ -7,7 +11,7 @@ LABEL version="${SERVER_VERSION}" \
description="A blazing fast and asynchronous web server for static files-serving." \
maintainer="Jose Quintana <joseluisq.net>"
COPY ./bin/static-web-server /
COPY --from=latest /usr/local/bin/static-web-server /
COPY ./public /public
EXPOSE 80