Skip to content

Commit

Permalink
Add eks go1.21 in builder-base (#1136)
Browse files Browse the repository at this point in the history
* Add eks go1.21 in builder-base

* update

* resolve merge conflict

* resolve merge conflict

* Add 1.21 in scripts

* bump go licenses versio

* test

* update golang release number
  • Loading branch information
zafs23 authored Sep 21, 2023
1 parent e97edf8 commit 8042657
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 3 deletions.
6 changes: 6 additions & 0 deletions EKS_DISTRO_TAG_FILE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ al2:
eks-distro-minimal-base-golang-compiler-1.20-base: 1.20-2023-09-13-1694631680.2
eks-distro-minimal-base-golang-compiler-1.20-yum: 1.20-yum-2023-09-13-1694631680.2
eks-distro-minimal-base-golang-compiler-1.20-gcc: 1.20-gcc-2023-09-13-1694631680.2
eks-distro-minimal-base-golang-compiler-1.21-base: null
eks-distro-minimal-base-golang-compiler-1.21-yum: null
eks-distro-minimal-base-golang-compiler-1.21-gcc: null
eks-distro-minimal-base-nodejs-compiler-16-base: 16-2023-09-13-1694631680.2
eks-distro-minimal-base-nodejs-compiler-16-yum: 16-yum-2023-09-13-1694631680.2
eks-distro-minimal-base-nodejs-compiler-16-gcc: 16-gcc-2023-09-13-1694631680.2
Expand Down Expand Up @@ -68,6 +71,9 @@ al2023:
eks-distro-minimal-base-golang-compiler-1.20-base: 1.20-2023-09-08-1694199666.2023
eks-distro-minimal-base-golang-compiler-1.20-yum: 1.20-yum-2023-09-08-1694199666.2023
eks-distro-minimal-base-golang-compiler-1.20-gcc: 1.20-gcc-2023-09-08-1694199666.2023
eks-distro-minimal-base-golang-compiler-1.21-base: null
eks-distro-minimal-base-golang-compiler-1.21-yum: null
eks-distro-minimal-base-golang-compiler-1.21-gcc: null
eks-distro-minimal-base-nodejs-compiler-16-base: 16-2023-09-08-1694199666.2023
eks-distro-minimal-base-nodejs-compiler-16-yum: 16-yum-2023-09-08-1694199666.2023
eks-distro-minimal-base-nodejs-compiler-16-gcc: 16-gcc-2023-09-08-1694199666.2023
Expand Down
33 changes: 33 additions & 0 deletions builder-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,22 @@ RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \
/install_golang.sh $GOLANG_VERSION_120 && \
/remove_yum_packages.sh

FROM ${BUILDER_IMAGE} as golang-1.21
ARG TARGETARCH
ARG GOLANG_VERSION_121
ARG GOLANG_RPM_SOURCE_DIR
WORKDIR /workdir
ENV GOPATH /go
ENV PATH="/go/bin/:$PATH"
COPY ./scripts/install_base_yum_packages.sh ./scripts/remove_yum_packages.sh ./scripts/common_vars.sh \
./scripts/install_golang.sh /
COPY $GOLANG_RPM_SOURCE_DIR/x86_64/golang*1.21*.rpm /tmp/x86_64/
COPY $GOLANG_RPM_SOURCE_DIR/aarch64/golang*1.21*.rpm /tmp/aarch64/
RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \
/install_base_yum_packages.sh && \
/install_golang.sh $GOLANG_VERSION_121 && \
/remove_yum_packages.sh

FROM ${BUILDER_IMAGE} as skopeo
ARG TARGETARCH
ARG GOPROXY
Expand Down Expand Up @@ -396,6 +412,21 @@ RUN --mount=type=cache,target=/root/.cache/go-build,sharing=locked \
--mount=type=secret,id=netrc,target=/root/.netrc \
/install_go_licenses.sh

FROM ${BUILDER_IMAGE} as go-licenses-1.21
ARG TARGETARCH
ARG GOPROXY
ARG GO_LICENSES_VERSION
ENV GO_LICENSES_VERSION=$GO_LICENSES_VERSION
WORKDIR /workdir
ENV GOPATH /go
ENV PATH="/go/bin/:$PATH"
COPY --link --from=golang-1.21 /golang-1.21 /
COPY ./scripts/common_vars.sh \
./scripts/install_go_licenses.sh /
RUN --mount=type=cache,target=/root/.cache/go-build,sharing=locked \
--mount=type=secret,id=netrc,target=/root/.netrc \
/install_go_licenses.sh


FROM ${BASE_IMAGE} as minimal-copy-stage

Expand Down Expand Up @@ -427,6 +458,8 @@ COPY --link --from=golang-1.19 /golang-1.19 /
COPY --link --from=go-licenses-1.19 /go-licenses-1.19 /
COPY --link --from=golang-1.20 /golang-1.20 /
COPY --link --from=go-licenses-1.20 /go-licenses-1.20 /
COPY --link --from=golang-1.21 /golang-1.21 /
COPY --link --from=go-licenses-1.21 /go-licenses-1.21 /
# add the default golang verison last so its /usr/bin/go
# takes precendent
COPY --link --from=golang-1.18 /golang-1.18 /
Expand Down
5 changes: 3 additions & 2 deletions builder-base/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ GOLANG_VERSION_117: 1.17.13-6
GOLANG_VERSION_118: 1.18.10-8
GOLANG_VERSION_119: 1.19.12-10
GOLANG_VERSION_120: 1.20.8-9
GO_LICENSES_VERSION: v1.2.1
GOLANG_VERSION_121: 1.21.1-2
GO_LICENSES_VERSION: v1.6.0
GOVC_VERSION: 0.25.0
GOSS_VERSION: 3.1.4
HELM_VERSION: 3.8.1
Expand All @@ -19,4 +20,4 @@ OVERRIDE_BASH_VERSION: 4.3
PACKER_VERSION: 1.8.5
PYWINRM_VERSION: 0.4.1
SKOPEO_VERSION: v1.5.2
YQ_VERSION: v4.30.6
YQ_VERSION: v4.30.6
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ batch:
env:
variables:
GO_SOURCE_VERSION: 1.20
- identifier: golang_121
env:
variables:
GO_SOURCE_VERSION: 1.21

env:
variables:
Expand Down
2 changes: 1 addition & 1 deletion projects/golang/go/scripts/golang-patching-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GO_REPO_URL="https://github.com/golang/go.git"

GO_REPO="$(dirname "$BASE_DIRECTORY")/go"

GO_VERSIONS=('1.18.10' '1.19.10' '1.20.5')
GO_VERSIONS=('1.18.10' '1.19.12' '1.20.8' '1.21.1')

function build::go::clone() {
if [[ ! -e $GO_REPO ]]; then
Expand Down

0 comments on commit 8042657

Please sign in to comment.