index : static-web-server.git

ascending towards madness

author Jose Quintana <1700322+joseluisq@users.noreply.github.com> 2024-02-06 21:56:11.0 +00:00:00
committer GitHub <noreply@github.com> 2024-02-06 21:56:11.0 +00:00:00
commit
a7dc6ace80c329ffaf45efd662da59867163f50c [patch]
tree
50ce3e30e6d287cf266a03cf7c2bddee131a56c2
parent
d4427eb3e100313d8e407af55a8e288d5a9516cc
download
a7dc6ace80c329ffaf45efd662da59867163f50c.tar.gz

refactor: drop linux ppc64le/s390x from alpine and scratch docker (#309)

The SWS binaries for ppc64le (powerpc64le-unknown-linux-gnu) and
s590x (s390x-unknown-linux-gnu) are dynamically linked so
it does **not** make so much sense to deliver them with either the
Alpine (musl) or the Scratch images (they even do not work properly as
of writing).

So we remove those two from the SWS Alpine and Scratch Docker image
variants to avoid misunderstandings or future issues.

The Debian Docker image should be preferred instead, either linux/ppc64le
or linux/s390x respectively.

This resolves #308

Diff

 .github/workflows/devel.docker.yml   |  2 --
 .github/workflows/release.docker.yml |  4 ++--
 docker/alpine/Dockerfile             | 12 ++----------
 docs/content/features/docker.md      |  4 ++--
 4 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/.github/workflows/devel.docker.yml b/.github/workflows/devel.docker.yml
index 15afc99..73c6989 100644
--- a/.github/workflows/devel.docker.yml
+++ b/.github/workflows/devel.docker.yml
@@ -29,8 +29,6 @@ jobs:
          - linux/arm64
          - linux/arm/v7
          - linux/arm/v6
          - linux/ppc64le
          - linux/s390x
    runs-on: ubuntu-22.04
    services:
      registry:
diff --git a/.github/workflows/release.docker.yml b/.github/workflows/release.docker.yml
index 9d0a778..47a02a4 100644
--- a/.github/workflows/release.docker.yml
+++ b/.github/workflows/release.docker.yml
@@ -59,7 +59,7 @@ jobs:
        with:
          push: true
          context: .
          platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6,linux/ppc64le,linux/s390x
          platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
          file: ./docker/alpine/Dockerfile
          tags: ${{ steps.meta_alpine.outputs.tags }}
          build-args: |
@@ -177,7 +177,7 @@ jobs:
        with:
          push: true
          context: .
          platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6,linux/ppc64le,linux/s390x
          platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
          file: ./docker/scratch/Dockerfile
          tags: ${{ steps.meta_scratch.outputs.tags }}
          build-args: |
diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile
index 998b704..e7a3dfb 100644
--- a/docker/alpine/Dockerfile
+++ b/docker/alpine/Dockerfile
@@ -13,8 +13,6 @@ RUN set -ex; \
        "linux/386") target='i686-unknown-linux-musl' ;; \
        "linux/arm/v7") target='armv7-unknown-linux-musleabihf' ;; \
        "linux/arm/v6") target='arm-unknown-linux-musleabihf' ;; \
        "linux/ppc64le") target='powerpc64le-unknown-linux-gnu' ;; \
        "linux/s390x") target='s390x-unknown-linux-gnu' ;; \
        *) echo >&2 "error: unsupported $TARGETPLATFORM architecture"; exit 1 ;; \
    esac; \
    wget --quiet -O /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"; \
@@ -27,14 +25,8 @@ RUN set -ex \
    && echo "Testing Docker image..." \
    && uname -a \
    && cat /etc/os-release \
    && case "$TARGETPLATFORM" in \
        **ppc64*|*s390x*) \
            echo "warn: can not run sws binary on $TARGETPLATFORM architecture" ;; \
        *) \
            static-web-server --version; \
            static-web-server --help; \
        ;; \
    esac \
    && static-web-server --version \
    && static-web-server --help \
    && file /usr/local/bin/static-web-server \
    && true

diff --git a/docs/content/features/docker.md b/docs/content/features/docker.md
index d4eb0da..aa42b41 100644
--- a/docs/content/features/docker.md
+++ b/docs/content/features/docker.md
@@ -15,8 +15,8 @@ All Docker images are [Multi-Arch](https://www.docker.com/blog/how-to-rapidly-bu
- `linux/arm/v6`
- `linux/arm/v7`
- `linux/arm64`
- `linux/ppc64le`
- `linux/s390x`
- `linux/ppc64le` (Debian only)
- `linux/s390x` (Debian only)

!!! tip "SWS statically-linked binary"
    All the Docker images use the SWS statically-linked binary, meaning that the binary is highly optimized, performant, and dependency-free thanks to [musl libc](https://www.musl-libc.org/).