diff --git a/go/1.21.1/22.03-lts-sp3/Dockerfile b/go/1.21.1/22.03-lts-sp3/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c4220cd750d6674fd3d8c5d486f65f9e02d760b0 --- /dev/null +++ b/go/1.21.1/22.03-lts-sp3/Dockerfile @@ -0,0 +1,34 @@ +ARG BASE=openeuler/openeuler:22.03-lts-sp3 +FROM ${BASE} + +ARG TARGETARCH +ARG LOCAL_PATH=/usr/local + +ENV GOPATH=/go +ENV GOTOOLCHAIN=local +ENV GOLANG_VERSION=1.21.1 +ENV GOROOT=$LOCAL_PATH/go +ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH + +RUN set -eux; \ + yum update -y && yum -y install g++ gcc glibc-devel make pkg-config findutils ca-certificates && yum clean all; \ + curl -fSL -o ${LOCAL_PATH}/go.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.linux-${TARGETARCH}.tar.gz; \ + tar -xvf ${LOCAL_PATH}/go.tar.gz -C ${LOCAL_PATH}; \ + rm -f ${LOCAL_PATH}/go.tar.gz + +RUN set -eux; \ + find ${GOROOT}/src -exec touch -r ${GOROOT}/VERSION "{}" \; && \ + touch ${GOROOT}/pkg; \ + find ${GOROOT}/pkg -exec touch -r ${GOROOT}/pkg "{}" \; && \ + mkdir -p ${GOROOT}/bin/linux_${TARGETARCH}; \ + ln -sf ${GOROOT}/bin/go ${GOROOT}/bin/linux_${TARGETARCH}/go; \ + ln -sf ${GOROOT}/bin/gofmt ${GOROOT}/bin/linux_${TARGETARCH}/gofmt + +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin"; \ + chmod -R 1777 "$GOPATH"; \ + yum -y remove g++ gcc glibc-devel make pkg-config findutils; \ + yum clean all + +WORKDIR $GOPATH + +CMD ["go", "version"] \ No newline at end of file diff --git a/go/1.22.5/22.03-lts-sp4/Dockerfile b/go/1.22.5/22.03-lts-sp4/Dockerfile index 90b033e195bafc6757e444b6b90b1ed5532765fd..b20065229a8dff9d6103aeb14766b37360b1799f 100644 --- a/go/1.22.5/22.03-lts-sp4/Dockerfile +++ b/go/1.22.5/22.03-lts-sp4/Dockerfile @@ -7,8 +7,8 @@ ARG LOCAL_PATH=/usr/local ENV GOPATH=/go ENV GOTOOLCHAIN=local ENV GOLANG_VERSION=1.22.5 -ENV GO_ROOT=${LOCAL_PATH}/go -ENV PATH=$GOPATH/bin:$GO_ROOT/bin:$PATH +ENV GOROOT=${LOCAL_PATH}/go +ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH RUN set -eux; \ yum update -y && yum -y install g++ gcc glibc-devel make pkg-config findutils && yum clean all; \ @@ -17,15 +17,17 @@ RUN set -eux; \ rm -f ${LOCAL_PATH}/go.tar.gz RUN set -eux; \ - find ${GO_ROOT}/src -exec touch -r ${GO_ROOT}/VERSION "{}" \; && \ - touch ${GO_ROOT}/pkg; \ - find ${GO_ROOT}/pkg -exec touch -r ${GO_ROOT}/pkg "{}" \; && \ - mkdir -p ${GO_ROOT}/bin/linux_${TARGETARCH}; \ - ln -sf ${GO_ROOT}/bin/go ${GO_ROOT}/bin/linux_${TARGETARCH}/go; \ - ln -sf ${GO_ROOT}/bin/gofmt ${GO_ROOT}/bin/linux_${TARGETARCH}/gofmt + find ${GOROOT}/src -exec touch -r ${GOROOT}/VERSION "{}" \; && \ + touch ${GOROOT}/pkg; \ + find ${GOROOT}/pkg -exec touch -r ${GOROOT}/pkg "{}" \; && \ + mkdir -p ${GOROOT}/bin/linux_${TARGETARCH}; \ + ln -sf ${GOROOT}/bin/go ${GOROOT}/bin/linux_${TARGETARCH}/go; \ + ln -sf ${GOROOT}/bin/gofmt ${GOROOT}/bin/linux_${TARGETARCH}/gofmt RUN mkdir -p "$GOPATH/src" "$GOPATH/bin"; \ - chmod -R 1777 "$GOPATH" + chmod -R 1777 "$GOPATH"; \ + yum -y remove g++ gcc glibc-devel make pkg-config findutils; \ + yum clean all WORKDIR $GOPATH diff --git a/go/README.md b/go/README.md index 86411330c7373bee6eb2b239c7f88e8d38342be5..a486dbb36d4d1e2ecc9374f99b64761b3acc9f68 100644 --- a/go/README.md +++ b/go/README.md @@ -1,9 +1,7 @@ # Quick reference -- The official Go docker image. - The official Go docker image. -- Maintained by: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative). - Maintained by: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative). - Where to get help: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative), [openEuler](https://gitee.com/openeuler/community). diff --git a/go/meta.yml b/go/meta.yml index 88075f6dcf6a2a62d7c92b12cd26d79da92c6fb7..4821e4407638b0e806d73e9260ec37bc90d3ab53 100644 --- a/go/meta.yml +++ b/go/meta.yml @@ -1,4 +1,6 @@ 1.17.3-oe2203lts: path: go/1.17.3/22.03-lts/Dockerfile +1.21.1-oe2203sp3: + path: go/1.21.1/22.03-lts-sp3/Dockerfile 1.22.5-oe2203sp4: path: go/1.22.5/22.03-lts-sp4/Dockerfile \ No newline at end of file