diff --git a/scripts/build_plugins.sh b/scripts/build_plugins.sh index 609610f5f..f5bdcd379 100755 --- a/scripts/build_plugins.sh +++ b/scripts/build_plugins.sh @@ -166,13 +166,10 @@ fi # get Go stable version # Dockerfiles do not allow env vars to be set by commands # and persist from one command to the next -# GO_OUTPUT=$(curl --silent https://go.dev/VERSION?m=text | cut -d "o" -f 2) -# OLD_IFS=$IFS -# IFS=$'\n' GO_STABLE_VERSION=($GO_OUTPUT) -# IFS=$OLD_IFS -# 2023-08-21: pinning to 1.20.7 go as 1.21.0 fails with FLB -# https://github.com/golang/go/issues/62130#issuecomment-1684431260 -export GO_STABLE_VERSION="1.20.7" +GO_OUTPUT=$(curl --silent https://go.dev/VERSION?m=text | cut -d "o" -f 2) +OLD_IFS=$IFS +IFS=$'\n' GO_STABLE_VERSION=($GO_OUTPUT) +IFS=$OLD_IFS echo "Using go:stable version ${GO_STABLE_VERSION}" PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg GO_STABLE_VERSION=${GO_STABLE_VERSION}" diff --git a/scripts/dockerfiles/Dockerfile.build b/scripts/dockerfiles/Dockerfile.build index 113e0814c..c617a496a 100644 --- a/scripts/dockerfiles/Dockerfile.build +++ b/scripts/dockerfiles/Dockerfile.build @@ -38,12 +38,11 @@ RUN yum install -y \ --slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \ --family cmake ENV HOME /home -ENV GO_STABLE_VERSION 1.20.7 # Lock Go Lang version to stable -# RUN export GO_STABLE_OUTPUT=`curl --silent https://go.dev/VERSION?m=text | cut -d "o" -f 2`; \ -# IFS=$'\n' GO_STABLE_VERSION=($GO_STABLE_OUTPUT); \ -RUN echo "Using go:stable version ${GO_STABLE_VERSION}"; \ +RUN export GO_STABLE_OUTPUT=`curl --silent https://go.dev/VERSION?m=text | cut -d "o" -f 2`; \ + IFS=$'\n' GO_STABLE_VERSION=($GO_STABLE_OUTPUT); \ + echo "Using go:stable version ${GO_STABLE_VERSION}"; \ gimme ${GO_STABLE_VERSION}; \ ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.arm64 /home/.gimme/versions/gostable.linux.arm64; \ ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.amd64 /home/.gimme/versions/gostable.linux.amd64 diff --git a/scripts/dockerfiles/Dockerfile.build-init b/scripts/dockerfiles/Dockerfile.build-init index 2c97d43e1..4588e907f 100644 --- a/scripts/dockerfiles/Dockerfile.build-init +++ b/scripts/dockerfiles/Dockerfile.build-init @@ -4,12 +4,11 @@ RUN curl -sL -o /bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/mas RUN chmod +x /bin/gimme RUN yum upgrade -y && yum install -y tar gzip git ENV HOME /home -ENV GO_STABLE_VERSION 1.20.7 # Lock Go Lang version to stable -# RUN export GO_STABLE_OUTPUT=`curl --silent https://go.dev/VERSION?m=text | cut -d "o" -f 2`; \ -# IFS=$'\n' GO_STABLE_VERSION=($GO_STABLE_OUTPUT); \ -RUN echo "Using go:stable version ${GO_STABLE_VERSION}"; \ +RUN export GO_STABLE_OUTPUT=`curl --silent https://go.dev/VERSION?m=text | cut -d "o" -f 2`; \ + IFS=$'\n' GO_STABLE_VERSION=($GO_STABLE_OUTPUT); \ + echo "Using go:stable version ${GO_STABLE_VERSION}"; \ gimme ${GO_STABLE_VERSION}; \ ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.arm64 /home/.gimme/versions/gostable.linux.arm64; \ ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.amd64 /home/.gimme/versions/gostable.linux.amd64