mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
maint: Update GoReleaser and CircleCI configs to publish multi-arch Docker image (#1682)
- Improve the filtering for the `release` job only on tag creation. - Removes the dependency on `integration-tests` job from the `release` job. The flaky tests were frequently blocking the release. - Integration tests will now only run on PRs. - Restores the Docker build/publish - Includes amd64, arm64, and i386 multi-arch manifest - Uploads [artifacts](https://app.circleci.com/pipelines/github/StackExchange/dnscontrol/1285/workflows/b40ce89b-5a60-4ed2-874b-d47f383122b2/jobs/10051/artifacts) to CircleCI - Fixes linting issues with README - Add [CircleCI Insights badge](https://github.com/StackExchange/dnscontrol/tree/fix/cci#dnscontrol) to README - Uploads deb and rpm packages to [CloudSmith](https://cloudsmith.io/~stackoverflow/repos/dnscontrol/packages/) - TODO: It looks like CloudSmith treats both formats as duplicates and appends a `-1` to the version. - TODO: Push the Docker images to CloudSmith as well (alternate to Docker Hub and their aggressive rate limits). - TODO: The automated release notes regex patterns don't work for most of the commits. See [releases/tag/v3.18.2-pre013](https://github.com/StackExchange/dnscontrol/releases/tag/v3.18.2-pre013)
This commit is contained in:
30
Dockerfile
30
Dockerfile
@@ -1,29 +1,13 @@
|
||||
FROM golang:1.19.0-alpine3.16@sha256:0eb08c89ab1b0c638a9fe2780f7ae3ab18f6ecda2c76b908e09eb8073912045d AS build
|
||||
# syntax = docker/dockerfile:1.4
|
||||
|
||||
WORKDIR /go/src/github.com/StackExchange/dnscontrol
|
||||
FROM alpine:3.16.2@sha256:bc41182d7ef5ffc53a40b044e725193bc10142a1243f395ee852a8d9730fc2ad as RUN
|
||||
|
||||
ARG BUILD_VERSION
|
||||
#RUN --mount=type=cache,target=/var/cache/apk \
|
||||
# apk update \
|
||||
# && apk add ca-certificates \
|
||||
# && update-ca-certificates
|
||||
|
||||
ENV GO111MODULE on
|
||||
|
||||
COPY . .
|
||||
|
||||
# build dnscontrol
|
||||
RUN apk update \
|
||||
&& apk add --no-cache ca-certificates curl gcc build-base git \
|
||||
&& update-ca-certificates \
|
||||
&& go build -v -trimpath -buildmode=pie -ldflags="-s -w -X main.SHA=${BUILD_VERSION}"
|
||||
|
||||
# Validation check
|
||||
RUN cp dnscontrol /go/bin/dnscontrol
|
||||
RUN dnscontrol version
|
||||
|
||||
# -----
|
||||
|
||||
FROM alpine:3.16.2@sha256:bc41182d7ef5ffc53a40b044e725193bc10142a1243f395ee852a8d9730fc2ad
|
||||
|
||||
COPY --from=build /etc/ssl/certs /etc/ssl/certs
|
||||
COPY --from=build /go/bin/dnscontrol /usr/local/bin
|
||||
COPY dnscontrol /usr/local/bin/
|
||||
|
||||
WORKDIR /dns
|
||||
|
||||
|
Reference in New Issue
Block a user