diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 154983f9..9ea6a9b9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,10 +7,7 @@ on: release: types: [published] env: - # This is limited by what's officially supported by https://github.com/alpinelinux/docker-alpine - # as long as we wish to release alpine-flavored images. "linux/riscv64" was not added because - # it only has an "edge" release for now. - platforms: "linux/386,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le,linux/s390x" + platforms: "linux/386,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le,linux/riscv64,linux/s390x" jobs: build: name: Build @@ -33,28 +30,9 @@ jobs: - run: echo '::set-output name=GIT_DESCRIBE::'`git describe --tags --always --long` name: Run `git describe` and save its output id: git-describe - - uses: docker/metadata-action@v4 - name: Calculate metadata for alpine-flavored Docker images - id: meta-alpine - with: - images: ${{ github.repository }} - flavor: | - suffix=-alpine - tags: | - type=edge - type=semver,pattern={{version}} - - uses: docker/build-push-action@v3 - name: Build alpine-flavored Docker images - with: - target: "alpine" - push: ${{ github.event_name != 'pull_request' }} - build-args: ${{ format('GIT_DESCRIBE={0}', steps.git-describe.outputs.GIT_DESCRIBE) }} - platforms: ${{ env.platforms }} - tags: ${{ steps.meta-alpine.outputs.tags }} - labels: ${{ steps.meta-alpine.outputs.labels }} - uses: docker/metadata-action@v4 name: Calculate metadata for minimal Docker images - id: meta-minimal + id: meta with: images: ${{ github.repository }} tags: | @@ -67,5 +45,5 @@ jobs: push: ${{ github.event_name != 'pull_request' }} build-args: ${{ format('GIT_DESCRIBE={0}', steps.git-describe.outputs.GIT_DESCRIBE) }} platforms: ${{ env.platforms }} - tags: ${{ steps.meta-minimal.outputs.tags }} - labels: ${{ steps.meta-minimal.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 7b759116..b57b35c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,16 +16,6 @@ COPY ["internal", "internal"] COPY ["cmd", "cmd"] RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOARM=${TARGETVARIANT#v} go build -tags timetzdata -o /bin/ddns -ldflags="-w -s -X main.Version=${GIT_DESCRIBE}" cmd/*.go -# After the compilation is done, we copied the program into alpine images -# with matching architectures. -FROM alpine:3.15.4 AS alpine -RUN \ - apk update && \ - apk add --no-cache ca-certificates && \ - update-ca-certificates -COPY --from=build /bin/ddns /bin/ -ENTRYPOINT ["/bin/ddns"] - # The minimal images contain only the program and the consolidated certificates. FROM scratch AS minimal COPY --from=build /bin/ddns /bin/