Skip to content

Commit a74c485

Browse files
Update base images to ECR public (#180)
Issue #, if available: aws-controllers-k8s/community#925 Description of changes: Modify all base and builder images to use ECR public instead of DockerHub - Requires AWS ECR Public login before any pulls By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent d20cb4f commit a74c485

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Dockerfile

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Base image to use for the final stage
2-
ARG base_image=amazonlinux:2
2+
ARG base_image=public.ecr.aws/amazonlinux/amazonlinux:2
33
# Build the manager binary
4-
FROM golang:1.14.1 as builder
4+
FROM public.ecr.aws/bitnami/golang:1.15.15 as builder
55

66
ARG service_alias
77
# The tuple of controller image version information
@@ -12,9 +12,7 @@ ARG build_date
1212
# service controller code.
1313
ARG work_dir=/github.com/aws-controllers-k8s/$service_alias-controller
1414
WORKDIR $work_dir
15-
# For building Go Module required
16-
# TODO(vijtrip2): After golang update to 1.15 or later, replace ',' with '|'
17-
ENV GOPROXY=https://proxy.golang.org,direct
15+
ENV GOPROXY=https://proxy.golang.org|direct
1816
ENV GO111MODULE=on
1917
ENV GOARCH=amd64
2018
ENV GOOS=linux

Dockerfile.local

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Base image to use at runtime
2-
ARG base_image=amazonlinux:2
2+
ARG base_image=public.ecr.aws/amazonlinux/amazonlinux:2
33
# Build the manager binary
4-
FROM golang:1.14.1 as builder
4+
FROM public.ecr.aws/bitnami/golang:1.15.15 as builder
55

66
ARG service_alias
77
# The tuple of controller image version information
@@ -12,8 +12,7 @@ ARG build_date
1212
# service controller code.
1313
ARG work_dir=/github.com/aws-controllers-k8s/$service_alias-controller
1414
WORKDIR $work_dir
15-
# For building Go Module required
16-
ENV GOPROXY=https://proxy.golang.org,direct
15+
ENV GOPROXY=https://proxy.golang.org|direct
1716
ENV GO111MODULE=on
1817
ENV GOARCH=amd64
1918
ENV GOOS=linux

scripts/build-controller-image.sh

+3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ if [[ $QUIET = "false" ]]; then
7474
echo " git commit: $SERVICE_CONTROLLER_GIT_COMMIT"
7575
fi
7676

77+
# Log into ECR public to access base images
78+
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
79+
7780
# if local build
7881
# then use Dockerfile which allows references to local modules from service controller
7982
DOCKER_BUILD_CONTEXT="$ACK_DIR"

0 commit comments

Comments
 (0)