From bd58d897373c948307c986aa3ddeec839112a678 Mon Sep 17 00:00:00 2001 From: Sergey Bogatyrets Date: Tue, 8 Nov 2022 14:41:28 +0300 Subject: [PATCH] Update workflows, add armv6 as deprectaed image from scratch --- .github/workflows/master.yml | 17 ++++++++++++++--- .github/workflows/release.yml | 21 +++++++++++++++++---- Dockerfile.armv6 | 13 +++++++++++++ 3 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 Dockerfile.armv6 diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 87785f4..499b42b 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -31,17 +31,28 @@ jobs: - name: Print builder available platforms run: echo ${{ steps.buildx.outputs.platforms }} - - name: Dockerhub login + - + name: Dockerhub login uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Run Buildx + name: Run Buildx for amd64, armv7, arm64 architectures run: | docker buildx build \ - --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 \ + --platform linux/amd64,linux/arm/v7,linux/arm64 \ --output "type=image,push=false" \ --push \ --tag "$DOCKERHUB_REPOSITORY:latest" \ . + # Legacy build for armv6 + - + name: Run Buildx for armv6 architecture + run: | + docker buildx build \ + --platform linux/arm/v6 \ + --output "type=image,push=false" \ + --push \ + --tag "$DOCKERHUB_REPOSITORY:latest" \ + Dockerfile.armv6 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e7fca40..8ee346b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,14 +18,17 @@ jobs: name: Set up Docker Buildx id: buildx uses: crazy-max/ghaction-docker-buildx@v1.1.0 - - name: Release version + - + name: Release version run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV - - name: Print release version + - + name: Print release version run: echo ${{ env.RELEASE_VERSION }} - - name: Dockerhub login + - + name: Dockerhub login run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Run Buildx + name: Run Buildx for amd64, armv7, arm64 architectures run: | docker buildx build \ --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 \ @@ -33,3 +36,13 @@ jobs: --push \ --tag "$DOCKERHUB_REPOSITORY:$RELEASE_VERSION" \ . + # Legacy build for armv6 + - + name: Run Buildx for armv6 architecture + run: | + docker buildx build \ + --platform linux/arm/v6 \ + --output "type=image,push=false" \ + --push \ + --tag "$DOCKERHUB_REPOSITORY:$RELEASE_VERSION" \ + Dockerfile.armv6 diff --git a/Dockerfile.armv6 b/Dockerfile.armv6 new file mode 100644 index 0000000..9552ce2 --- /dev/null +++ b/Dockerfile.armv6 @@ -0,0 +1,13 @@ +ARG GOLANG_VERSION="1.19.1" + +FROM golang:$GOLANG_VERSION-alpine as builder +RUN apk --no-cache add tzdata +WORKDIR /go/src/github.com/serjs/socks5 +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-s' -o ./socks5 + +FROM SCRATCH +COPY --from=builder /go/src/github.com/serjs/socks5/socks5 / +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +COPY --from=builder /go/src/github.com/serjs/socks5/socks5 / +ENTRYPOINT ["/socks5"]