From a0c496274662053654761f0030c2e10f06cc0427 Mon Sep 17 00:00:00 2001 From: Adam Chalkley Date: Thu, 3 Feb 2022 06:11:56 -0600 Subject: [PATCH] Mirror upstream golang image with light changes - add new Dockerfile to build lightly touched variation of upstream `golang` image - add additional metadata tying the image to the atc0005/go-ci repo - update dependabot config to monitor the new Dockerfile for image version updates - update README to cover new image - update Makefile to handle building and uploading new image refs GH-507 refs atc0005/send2teams#211 refs atc0005/send2teams#210 --- .github/dependabot.yml | 18 ++++++++++++++++++ Makefile | 19 +++++++++++++++++++ README.md | 10 ++++++++++ stable/build/mirror/Dockerfile | 22 ++++++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 stable/build/mirror/Dockerfile diff --git a/.github/dependabot.yml b/.github/dependabot.yml index aa821ff8..9fd21431 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -177,6 +177,24 @@ updates: commit-message: prefix: "docker" + - package-ecosystem: docker + directory: "/stable/build/mirror" + open-pull-requests-limit: 10 + target-branch: "master" + schedule: + interval: "daily" + time: "02:00" + timezone: "America/Chicago" + assignees: + - "atc0005" + labels: + - "dependencies" + - "CI" + allow: + - dependency-type: "all" + commit-message: + prefix: "docker" + - package-ecosystem: docker directory: "/unstable" open-pull-requests-limit: 10 diff --git a/Makefile b/Makefile index 63667c5d..c56eec96 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,7 @@ GITHUB_IMAGE_REGISTRY_USER = atc0005 DOCKER_IMAGE_REPO = go-ci GITHUB_PROJECT_REPO = go-ci DOCKER_IMAGE_NAME_DEBIAN_BUILD = go-ci-stable-debian-build +DOCKER_IMAGE_NAME_MIRROR_BUILD = go-ci-stable-mirror-build DOCKER_IMAGE_NAME_ALPINE_BUILDX86 = go-ci-stable-alpine-buildx86 DOCKER_IMAGE_NAME_ALPINE_BUILDX64 = go-ci-stable-alpine-buildx64 DOCKER_IMAGE_NAME_STABLE = go-ci-stable @@ -52,6 +53,7 @@ DOCKER_FILES = oldstable/Dockerfile \ stable/build/alpine-x64/Dockerfile \ stable/build/alpine-x86/Dockerfile \ stable/build/debian/Dockerfile \ + stable/build/mirror/Dockerfile \ stable/combined/Dockerfile \ stable/linting/Dockerfile \ unstable/Dockerfile \ @@ -168,6 +170,19 @@ build: --label=$(DOCKER_IMAGE_REVISION_LABEL) \ --label=$(DOCKER_IMAGE_CREATED_LABEL) + @echo "Building stable-mirror-build release" + sudo docker image build \ + --pull \ + --no-cache \ + stable/build/mirror/ \ + -t $(DOCKER_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_MIRROR_BUILD) \ + -t $(DOCKER_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_MIRROR_BUILD)-$(REPO_VERSION) \ + -t $(GITHUB_IMAGE_REGISTRY)/$(GITHUB_IMAGE_REGISTRY_USER)/$(GITHUB_PROJECT_REPO):$(DOCKER_IMAGE_NAME_MIRROR_BUILD) \ + -t $(GITHUB_IMAGE_REGISTRY)/$(GITHUB_IMAGE_REGISTRY_USER)/$(GITHUB_PROJECT_REPO):$(DOCKER_IMAGE_NAME_MIRROR_BUILD)-$(REPO_VERSION) \ + --label=$(DOCKER_IMAGE_OWNER_LABEL) \ + --label=$(DOCKER_IMAGE_REVISION_LABEL) \ + --label=$(DOCKER_IMAGE_CREATED_LABEL) + @echo "Building stable linting-only release" sudo docker image build \ --pull \ @@ -244,6 +259,8 @@ upload: @sudo docker push $(DOCKER_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_ALPINE_BUILDX64)-$(REPO_VERSION) @sudo docker push $(DOCKER_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_DEBIAN_BUILD) @sudo docker push $(DOCKER_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_DEBIAN_BUILD)-$(REPO_VERSION) + @sudo docker push $(DOCKER_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_MIRROR_BUILD) + @sudo docker push $(DOCKER_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_MIRROR_BUILD)-$(REPO_VERSION) @sudo docker push $(DOCKER_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_STABLE_LINT_ONLY) @sudo docker push $(DOCKER_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_STABLE_LINT_ONLY)-$(REPO_VERSION) @sudo docker push $(DOCKER_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_OLDSTABLE) @@ -269,6 +286,8 @@ upload: @sudo docker push $(GITHUB_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_ALPINE_BUILDX64)-$(REPO_VERSION) @sudo docker push $(GITHUB_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_DEBIAN_BUILD) @sudo docker push $(GITHUB_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_DEBIAN_BUILD)-$(REPO_VERSION) + @sudo docker push $(GITHUB_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_MIRROR_BUILD) + @sudo docker push $(GITHUB_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_MIRROR_BUILD)-$(REPO_VERSION) @sudo docker push $(GITHUB_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_STABLE_LINT_ONLY) @sudo docker push $(GITHUB_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_STABLE_LINT_ONLY)-$(REPO_VERSION) @sudo docker push $(GITHUB_IMAGE_REGISTRY)/$(DOCKER_IMAGE_REGISTRY_USER)/$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_NAME_OLDSTABLE) diff --git a/README.md b/README.md index b5b248ce..8345a97d 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Tooling for linting, testing and building Go applications - [`go-ci-stable-alpine-buildx86`](#go-ci-stable-alpine-buildx86) - [`go-ci-stable-alpine-buildx64`](#go-ci-stable-alpine-buildx64) - [`go-ci-stable-debian-build`](#go-ci-stable-debian-build) + - [`go-ci-stable-mirror-build`](#go-ci-stable-mirror-build) - [`go-ci-oldstable`](#go-ci-oldstable) - [`go-ci-unstable`](#go-ci-unstable) - [`go-ci-lint-only`](#go-ci-lint-only) @@ -101,6 +102,15 @@ images: - provides multiple linters - see [Linting tools included](#linting-tools-included) +### `go-ci-stable-mirror-build` + +- built from the latest version of the current stable `golang` image. +- intended to mirror current upstream stable `golang` image for + Makefile-driven testing, linting and build tasks. +- few (if any) customizations are intended for this image, instead relying on + a project's Makefile or other build tool to setup the environment for tasks + such as testing, linting & building source code + ### `go-ci-oldstable` - built from the latest version of the current outgoing stable `golang` image. diff --git a/stable/build/mirror/Dockerfile b/stable/build/mirror/Dockerfile new file mode 100644 index 00000000..3297424d --- /dev/null +++ b/stable/build/mirror/Dockerfile @@ -0,0 +1,22 @@ +# Copyright 2020 Adam Chalkley +# +# https://github.com/atc0005/go-ci +# +# Licensed under the MIT License. See LICENSE file in the project root for +# full license information. + +# https://hub.docker.com/_/golang + +FROM golang:1.17.6 + +# https://docs.github.com/en/packages/learn-github-packages/connecting-a-repository-to-a-package +LABEL org.opencontainers.image.source="https://github.com/atc0005/go-ci" + +# https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys +LABEL org.opencontainers.image.documentation="https://github.com/atc0005/go-ci" +LABEL org.opencontainers.image.url="https://github.com/atc0005/go-ci" +LABEL org.opencontainers.image.title="go-ci-stable-upstream-mirror" +LABEL org.opencontainers.image.description="Docker image intended to mirror \ + current upstream stable golang image for Makefile-driven test, linting \ + and build tasks. Very few modifications are made to the original image." +LABEL org.opencontainers.image.authors="Adam Chalkley (github.com/atc0005)"