Skip to content

Commit

Permalink
Mirror upstream golang image with light changes
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
atc0005 committed Feb 3, 2022
1 parent 672ed4e commit a0c4962
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down
22 changes: 22 additions & 0 deletions stable/build/mirror/Dockerfile
Original file line number Diff line number Diff line change
@@ -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)"

0 comments on commit a0c4962

Please sign in to comment.