Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debian docker images using statically-linked binary (musl)
debian 12.0 image variants: - docker pull joseluisq/static-web-server:2-debian - docker pull joseluisq/static-web-server:2.y-debian - docker pull joseluisq/static-web-server:2.y.z-debian
- Loading branch information
Showing
8 changed files
with
333 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
FROM --platform=$BUILDPLATFORM debian:12.0-slim as build | ||
|
||
ARG TARGETPLATFORM | ||
ARG SERVER_VERSION=0.0.0 | ||
ENV SERVER_VERSION=${SERVER_VERSION} | ||
|
||
RUN set -eux \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \ | ||
ca-certificates \ | ||
curl \ | ||
file \ | ||
tzdata \ | ||
&& true | ||
|
||
RUN set -ex \ | ||
&& case "$TARGETPLATFORM" in \ | ||
"linux/amd64") target='x86_64-unknown-linux-musl' ;; \ | ||
"linux/arm64") target='aarch64-unknown-linux-musl' ;; \ | ||
"linux/386") target='i686-unknown-linux-musl' ;; \ | ||
"linux/arm/v7") target='armv7-unknown-linux-musleabihf' ;; \ | ||
"linux/arm/v6") target='arm-unknown-linux-musleabihf' ;; \ | ||
*) echo >&2 "error: unsupported $TARGETPLATFORM architecture"; exit 1 ;; \ | ||
esac \ | ||
&& curl -Lo /tmp/static-web-server.tar.gz \ | ||
"https://github.com/static-web-server/static-web-server/releases/download/v${SERVER_VERSION}/static-web-server-v${SERVER_VERSION}-${target}.tar.gz" \ | ||
&& tar xzvf /tmp/static-web-server.tar.gz \ | ||
&& cp static-web-server-v${SERVER_VERSION}-${target}/static-web-server /usr/local/bin/ \ | ||
&& rm -rf /tmp/static-web-server.tar.gz static-web-server-v${SERVER_VERSION}-${target} \ | ||
&& chmod +x /usr/local/bin/static-web-server \ | ||
&& true | ||
|
||
RUN set -ex \ | ||
&& echo "Testing Docker image..." \ | ||
&& uname -a \ | ||
&& cat /etc/os-release \ | ||
&& echo VERSION_NUMBER=$(cat /etc/debian_version) \ | ||
&& static-web-server --version \ | ||
&& static-web-server --help \ | ||
&& file /usr/local/bin/static-web-server \ | ||
&& true | ||
|
||
FROM debian:12.0-slim | ||
|
||
ARG SERVER_VERSION=0.0.0 | ||
ENV SERVER_VERSION=${SERVER_VERSION} | ||
|
||
LABEL version="${SERVER_VERSION}" \ | ||
description="A cross-platform, high-performance and asynchronous web server for static files-serving." \ | ||
maintainer="Jose Quintana <joseluisq.net>" | ||
|
||
RUN set -eux \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \ | ||
ca-certificates \ | ||
tzdata \ | ||
# Clean up local repository of retrieved packages and remove the package lists | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& true | ||
|
||
COPY --from=build /usr/local/bin/static-web-server /usr/local/bin/ | ||
COPY ./docker/debian/entrypoint.sh / | ||
COPY ./docker/public /public | ||
|
||
EXPOSE 80 | ||
|
||
STOPSIGNAL SIGQUIT | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
CMD ["static-web-server"] | ||
|
||
# Metadata | ||
LABEL org.opencontainers.image.vendor="Jose Quintana" \ | ||
org.opencontainers.image.url="https://github.com/static-web-server/static-web-server" \ | ||
org.opencontainers.image.title="Static Web Server" \ | ||
org.opencontainers.image.description="A cross-platform, high-performance and asynchronous web server for static files-serving." \ | ||
org.opencontainers.image.version="${SERVER_VERSION}" \ | ||
org.opencontainers.image.documentation="https://static-web-server.net" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# Check if incoming command contains flags. | ||
if [ "${1#-}" != "$1" ]; then | ||
set -- static-web-server "$@" | ||
fi | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM debian:12.0-slim | ||
|
||
ENV SERVER_VERSION=devel | ||
|
||
LABEL version="${SERVER_VERSION}" \ | ||
description="A cross-platform, high-performance and asynchronous web server for static files-serving." \ | ||
maintainer="Jose Quintana <joseluisq.net>" | ||
|
||
RUN set -eux \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \ | ||
ca-certificates \ | ||
tzdata \ | ||
# Clean up local repository of retrieved packages and remove the package lists | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& true | ||
|
||
COPY ./docker/devel/static-web-server /usr/local/bin/ | ||
COPY ./docker/debian/entrypoint.sh / | ||
COPY ./docker/public /public | ||
|
||
EXPOSE 80 | ||
|
||
STOPSIGNAL SIGQUIT | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
CMD ["static-web-server"] | ||
|
||
# Metadata | ||
LABEL org.opencontainers.image.vendor="Jose Quintana" \ | ||
org.opencontainers.image.url="https://github.com/static-web-server/static-web-server" \ | ||
org.opencontainers.image.title="Static Web Server" \ | ||
org.opencontainers.image.description="A cross-platform, high-performance and asynchronous web server for static files-serving." \ | ||
org.opencontainers.image.version="${SERVER_VERSION}" \ | ||
org.opencontainers.image.documentation="https://github.com/static-web-server/static-web-server" |
Oops, something went wrong.