From a9b2bc8cec74f6590302d0329a0b0a91521d5363 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Mon, 20 Mar 2023 09:28:17 +0100 Subject: [PATCH] replace use of docker registry docker.io (hub.docker.com) with self-hosted r.xmox.nl when setting up the docker organization account for mox it already felt off. depending on such a party to serve binaries didn't feel great to begin with. after clarifying online discussions of docker's vague announcement of removing free team organizations it was clearly time to move off hub.docker.com. best to self-host. r.xmox.nl is hosted with the new github.com/mjl-/vex. pinging issue #3 --- README.md | 11 +++++------ docker-compose.yml | 5 +++-- docker-release.sh | 11 ++++++----- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index a39633d..91b25e5 100644 --- a/README.md +++ b/README.md @@ -60,12 +60,11 @@ Verify you have a working mox binary: Note: Mox only compiles for/works on unix systems, not on Plan 9 or Windows. -You can also run mox with docker image "docker.io/moxmail/mox", with tags like -"latest", "0.0.1" and "0.0.1-go1.20.1-alpine3.17.2", see -https://hub.docker.com/r/moxmail/mox. See docker-compose.yml in this -repository for instructions on starting. You must run docker with host -networking, because mox needs to find your actual public IP's and get the -remote IPs for incoming connections, not a local/internal NAT IP. +You can also run mox with docker image `r.xmox.nl/mox`, with tags like `v0.0.1` +and `v0.0.1-go1.20.1-alpine3.17.2`, see https://r.xmox.nl/repo/mox/. See +docker-compose.yml in this repository for instructions on starting. You must run +docker with host networking, because mox needs to find your actual public IP's +and get the remote IPs for incoming connections, not a local/internal NAT IP. # Quickstart diff --git a/docker-compose.yml b/docker-compose.yml index d9aa58e..ae1652b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,8 +14,9 @@ version: '3.7' services: mox: - # Replace latest with the version you want to run. - image: docker.io/moxmail/mox:latest + # Replace "latest" with the version you want to run, see https://r.xmox.nl/repo/mox/. + # Include the @sha256:... digest to ensure you get the listed image. + image: r.xmox.nl/mox:latest environment: - MOX_DOCKER=yes # Quickstart won't try to write systemd service file. # Mox needs host networking because it needs access to the IPs of the diff --git a/docker-release.sh b/docker-release.sh index 8476d5a..c0eb916 100755 --- a/docker-release.sh +++ b/docker-release.sh @@ -36,19 +36,20 @@ echo Building with $goversion and $alpineversion # needed because the platform in "FROM --platform " in the first stage # seems to override the TARGET* variables. test -d empty || mkdir empty -(podman manifest rm moxmail/mox:$moxversion-$goversion-$alpineversion || exit 0) +((rm -r tmp/gomod || exit 0); mkdir -p tmp/gomod) # fetch modules through goproxy just once +(podman manifest rm mox:$moxversion-$goversion-$alpineversion || exit 0) for platform in $(echo $platforms | sed 's/,/ /g'); do goos=$(echo $platform | sed 's,/.*$,,') goarch=$(echo $platform | sed 's,^.*/,,') - podman build --platform $platform -f Dockerfile.release -v $HOME/go/pkg/sumdb:/go/pkg/sumbd:ro --build-arg goos=$goos --build-arg goarch=$goarch --build-arg moxversion=$moxversion --manifest moxmail/mox:$moxversion-$goversion-$alpineversion empty + podman build --platform $platform -f Dockerfile.release -v $HOME/go/pkg/sumdb:/go/pkg/sumbd:ro -v $PWD/tmp/gomod:/go/pkg/mod --build-arg goos=$goos --build-arg goarch=$goarch --build-arg moxversion=$moxversion --manifest mox:$moxversion-$goversion-$alpineversion empty done cat <