diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile index cd1ac8b7..e88d4078 100644 --- a/docker/alpine/Dockerfile +++ b/docker/alpine/Dockerfile @@ -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"] diff --git a/docker/scratch/Dockerfile b/docker/scratch/Dockerfile index 1325711d..0e9728ff 100644 --- a/docker/scratch/Dockerfile +++ b/docker/scratch/Dockerfile @@ -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 " -COPY ./bin/static-web-server / +COPY --from=latest /usr/local/bin/static-web-server / COPY ./public /public EXPOSE 80