diff --git a/Dockerfile b/Dockerfile index fa6cc94c5..82f16aad7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ -FROM golang AS builder +FROM golang:alpine AS builder COPY . /go/src/github.com/rclone/rclone/ WORKDIR /go/src/github.com/rclone/rclone/ +RUN apk add --no-cache make bash gawk git RUN \ CGO_ENABLED=0 \ make diff --git a/RELEASE.md b/RELEASE.md index 09bc34a4d..71e5b7918 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -124,32 +124,21 @@ Cherry pick any changes back to master and the stable branch if it is active. ## Making a manual build of docker -The rclone docker image should autobuild on via GitHub actions. If it doesn't -or needs to be updated then rebuild like this. - -See: https://github.com/ilteoood/docker_buildx/issues/19 -See: https://github.com/ilteoood/docker_buildx/blob/master/scripts/install_buildx.sh +To do a basic build of rclone's docker image to debug builds locally: + +``` +docker buildx build --load -t rclone/rclone:testing --progress=plain . +docker run --rm rclone/rclone:testing version +``` + +To test the multipatform build + +``` +docker buildx build -t rclone/rclone:testing --progress=plain --platform linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6 . +``` + +To make a full build then set the tags correctly and add `--push` ``` -git co v1.54.1 -docker pull golang -export DOCKER_CLI_EXPERIMENTAL=enabled -docker buildx create --name actions_builder --use -docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3 -docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -SUPPORTED_PLATFORMS=$(docker buildx inspect --bootstrap | grep 'Platforms:*.*' | cut -d : -f2,3) -echo "Supported platforms: $SUPPORTED_PLATFORMS" docker buildx build --platform linux/amd64,linux/386,linux/arm64,linux/arm/v7 -t rclone/rclone:1.54.1 -t rclone/rclone:1.54 -t rclone/rclone:1 -t rclone/rclone:latest --push . -docker buildx stop actions_builder -``` - -### Old build for linux/amd64 only - -``` -docker pull golang -docker build --rm --ulimit memlock=67108864 -t rclone/rclone:1.52.0 -t rclone/rclone:1.52 -t rclone/rclone:1 -t rclone/rclone:latest . -docker push rclone/rclone:1.52.0 -docker push rclone/rclone:1.52 -docker push rclone/rclone:1 -docker push rclone/rclone:latest ```