Skip to content

Commit

Permalink
Remove alpine images (#158)
Browse files Browse the repository at this point in the history
* fix!: drop alpine support

* feat: support risvc64
  • Loading branch information
favonia authored May 7, 2022
1 parent b63277d commit 7425bc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 36 deletions.
30 changes: 4 additions & 26 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand All @@ -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 }}
10 changes: 0 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down

0 comments on commit 7425bc2

Please sign in to comment.