Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[go1.17] Build images for go1.17 #2211

Merged
merged 13 commits into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile-kubepkg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.16.7 AS builder
FROM golang:1.16.7-buster AS builder

ENV GO111MODULE=on

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-kubepkg-rpm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.16.7 AS builder
FROM golang:1.16.7-buster AS builder

ENV GO111MODULE=on

Expand Down
10 changes: 8 additions & 2 deletions cloudbuild-kubepkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
timeout: 1200s
options:
substitution_option: ALLOW_LOOSE

steps:
- name: gcr.io/cloud-builders/docker
args:
Expand All @@ -19,14 +20,19 @@ steps:
- --tag=$_REGISTRY/kubepkg-rpm:$_GIT_TAG
- --tag=$_REGISTRY/kubepkg-rpm:latest
- .

substitutions:
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
# can be used as a substitution
_GIT_TAG: '12345'
_PULL_BASE_REF: 'dev'
_REGISTRY: 'fake.repository/registry-name'
# TODO(images): Remove once CI failures are resolved.
_CI_FAILURES: 'https://prow.k8s.io/view/gs/kubernetes-jenkins/logs/post-release-push-image-kubepkg/1382830189301469184'

tags:
- 'kubepkg'
- ${_GIT_TAG}
- ${_PULL_BASE_REF}

images:
- 'gcr.io/$PROJECT_ID/kubepkg:$_GIT_TAG'
- 'gcr.io/$PROJECT_ID/kubepkg:latest'
Expand Down
4 changes: 3 additions & 1 deletion cmd/vulndash/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@

# Build the manager binary
ARG GO_VERSION
ARG OS_CODENAME
# TODO(codename): Consider parameterizing in Makefile based on codename
ARG DISTROLESS_IMAGE
FROM golang:${GO_VERSION} as builder
FROM golang:${GO_VERSION}-${OS_CODENAME} as builder

WORKDIR /go/src/k8s.io/release

Expand Down
6 changes: 5 additions & 1 deletion cmd/vulndash/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,27 @@ SHELL=/bin/bash -o pipefail
REGISTRY ?= gcr.io/k8s-staging-artifact-promoter
IMGNAME = vulndash
IMAGE_VERSION ?= v0.4.3-7
CONFIG ?= buster

IMAGE = $(REGISTRY)/$(IMGNAME)

TAG ?= $(shell git describe --tags --always --dirty)

# Build args
GO_VERSION ?= 1.16.7
OS_CODENAME ?= buster
DISTROLESS_IMAGE ?= static-debian10

# Configuration
CONFIG = $(OS_CODENAME)

PLATFORMS ?= linux/amd64

HOST_GOOS ?= $(shell go env GOOS)
HOST_GOARCH ?= $(shell go env GOARCH)
GO_BUILD ?= go build

BUILD_ARGS = --build-arg=GO_VERSION=$(GO_VERSION) \
--build-arg=OS_CODENAME=$(OS_CODENAME) \
--build-arg=DISTROLESS_IMAGE=$(DISTROLESS_IMAGE)

# Ensure support for 'docker buildx' and 'docker manifest' commands
Expand Down
3 changes: 3 additions & 0 deletions cmd/vulndash/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ steps:
- PULL_BASE_REF=$_PULL_BASE_REF
- IMAGE_VERSION=$_IMAGE_VERSION
- GO_VERSION=$_GO_VERSION
- OS_CODENAME=$_OS_CODENAME
- DISTROLESS_IMAGE=$_DISTROLESS_IMAGE
args:
- '-c'
Expand All @@ -33,6 +34,7 @@ substitutions:
_PULL_BASE_REF: 'dev'
_IMAGE_VERSION: 'v0.0.0'
_GO_VERSION: '0.0.0'
_OS_CODENAME: 'codename'
_DISTROLESS_IMAGE: 'static-debian00'

tags:
Expand All @@ -41,6 +43,7 @@ tags:
- ${_PULL_BASE_REF}
- ${_IMAGE_VERSION}
- ${_GO_VERSION}
- ${_OS_CODENAME}
- ${_DISTROLESS_IMAGE}

images:
Expand Down
1 change: 1 addition & 0 deletions cmd/vulndash/variants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ variants:
default:
IMAGE_VERSION: 'v0.4.3-7'
GO_VERSION: '1.16.7'
OS_CODENAME: 'buster'
DISTROLESS_IMAGE: 'static-debian10'
Loading