diff --git a/ops/deploy.sh b/ops/deploy.sh index 6c6d70d..cadb15b 100755 --- a/ops/deploy.sh +++ b/ops/deploy.sh @@ -31,7 +31,7 @@ echo docker build -t ${REPO}/${DEPLOYPREFIX}:${TAGS_PLUS_LATEST//,/ -t ${REPO}/$ read -rsp $'Press enter to continue...\n' # build -docker build -t ${REPO}/${DEPLOYPREFIX}:${TAGS_PLUS_LATEST//,/ -t ${REPO}/${DEPLOYPREFIX}:} -f ${DEPLOYPREFIX}/Dockerfile . +docker build --platform linux/x86_64 -t ${REPO}/${DEPLOYPREFIX}:${TAGS_PLUS_LATEST//,/ -t ${REPO}/${DEPLOYPREFIX}:} -f ${DEPLOYPREFIX}/Dockerfile . echo "build done for ${REPO}/${DEPLOYPREFIX}" echo "running tests" diff --git a/pypyr-go/Dockerfile b/pypyr-go/Dockerfile index 1313a6f..0219ff1 100644 --- a/pypyr-go/Dockerfile +++ b/pypyr-go/Dockerfile @@ -7,7 +7,7 @@ # docker build -t pypyr/pypyr-go -t pypyr/pypyr-go:latest -t pypyr/pypyr-go:1.10 -t pypyr/pypyr-go:1.10.3 -f pypyr-go/Dockerfile . FROM pypyr/pypyr:5.9.1 -ARG goversion=1.15.7 +ARG goversion=1.21.4 # username for limited user from base image ARG limiteduser=pypyruser @@ -31,58 +31,67 @@ ENV PATH /usr/local/go/bin:$PATH ENV GOLANG_VERSION=${goversion} RUN set -eux; \ - \ - dpkgArch="$(dpkg --print-architecture)"; \ - case "${dpkgArch##*-}" in \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ + url=; \ + case "$arch" in \ 'amd64') \ - arch='linux-amd64'; \ - url='https://storage.googleapis.com/golang/go1.15.7.linux-amd64.tar.gz'; \ - sha256='0d142143794721bb63ce6c8a6180c4062bcf8ef4715e7d6d6609f3a8282629b3'; \ + url='https://dl.google.com/go/go1.21.4.linux-amd64.tar.gz'; \ + sha256='73cac0215254d0c7d1241fa40837851f3b9a8a742d0b54714cbdfb3feaf8f0af'; \ + ;; \ + 'armel') \ + export GOARCH='arm' GOARM='5' GOOS='linux'; \ ;; \ 'armhf') \ - arch='linux-armv6l'; \ - url='https://storage.googleapis.com/golang/go1.15.7.linux-armv6l.tar.gz'; \ - sha256='8ab192799a191eb3752079ab17efff12d1d7dd0e965cf84dcbf08d55542e27d3'; \ + url='https://dl.google.com/go/go1.21.4.linux-armv6l.tar.gz'; \ + sha256='6c62e89113750cc77c498194d13a03fadfda22bd2c7d44e8a826fd354db60252'; \ ;; \ 'arm64') \ - arch='linux-arm64'; \ - url='https://storage.googleapis.com/golang/go1.15.7.linux-arm64.tar.gz'; \ - sha256='bca4af0c20f86521dfabf3b39fa2f1ceeeb11cebf7e90bdf1de2618c40628539'; \ + url='https://dl.google.com/go/go1.21.4.linux-arm64.tar.gz'; \ + sha256='ce1983a7289856c3a918e1fd26d41e072cc39f928adfb11ba1896440849b95da'; \ ;; \ 'i386') \ - arch='linux-386'; \ - url='https://storage.googleapis.com/golang/go1.15.7.linux-386.tar.gz'; \ - sha256='519e5d7518376bc6b87afc04f16e72db66d9bc08641d9b4385ecf1f30e55e64c'; \ + url='https://dl.google.com/go/go1.21.4.linux-386.tar.gz'; \ + sha256='64d3e5d295806e137c9e39d1e1f10b00a30fcd5c2f230d72b3298f579bb3c89a'; \ + ;; \ + 'mips64el') \ + url='https://dl.google.com/go/go1.21.4.linux-mips64le.tar.gz'; \ + sha256='c7ce3a9dcf03322b79beda474c4a0154393d9029b48f7c2e260fb3365c8a6ad3'; \ ;; \ 'ppc64el') \ - arch='linux-ppc64le'; \ - url='https://storage.googleapis.com/golang/go1.15.7.linux-ppc64le.tar.gz'; \ - sha256='665bbd512dcc83f15e0d48140f687e3dedf5103c363599ef910a5328894bf039'; \ + url='https://dl.google.com/go/go1.21.4.linux-ppc64le.tar.gz'; \ + sha256='2c63b36d2adcfb22013102a2ee730f058ec2f93b9f27479793c80b2e3641783f'; \ + ;; \ + 'riscv64') \ + url='https://dl.google.com/go/go1.21.4.linux-riscv64.tar.gz'; \ + sha256='9695edd2109544b364daddb32816f5c7980f1f48b8490c51fa2c167f5b2eca48'; \ ;; \ 's390x') \ - arch='linux-s390x'; \ - url='https://storage.googleapis.com/golang/go1.15.7.linux-s390x.tar.gz'; \ - sha256='d15867ee945cb7b18a627a4eb55e2ee1fb7bf04c138ed8bb741a5f727c35819f'; \ + url='https://dl.google.com/go/go1.21.4.linux-s390x.tar.gz'; \ + sha256='7a75ba4afc7a96058ca65903d994cd862381825d7dca12b2183f087c757c26c0'; \ ;; \ - *) \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + build=; \ + if [ -z "$url" ]; then \ # https://github.com/golang/go/issues/38536#issuecomment-616897960 - arch='src'; \ - url='https://storage.googleapis.com/golang/go1.15.7.src.tar.gz'; \ - sha256='8631b3aafd8ecb9244ec2ffb8a2a8b4983cf4ad15572b9801f7c5b167c1a2abc'; \ + build=1; \ + url='https://dl.google.com/go/go1.21.4.src.tar.gz'; \ + sha256='47b26a83d2b65a3c1c1bcace273b69bee49a7a7b5168a7604ded3d26a37bd787'; \ echo >&2; \ - echo >&2 "warning: current architecture ($dpkgArch) does not have a corresponding Go binary release; will be building from source"; \ + echo >&2 "warning: current architecture ($arch) does not have a compatible Go binary release; will be building from source"; \ echo >&2; \ - ;; \ - esac; \ + fi; \ \ - wget -O go.tgz.asc "$url.asc" --progress=dot:giga; \ + wget -O go.tgz.asc "$url.asc"; \ wget -O go.tgz "$url" --progress=dot:giga; \ - echo "$sha256 *go.tgz" | sha256sum --strict --check -; \ + echo "$sha256 *go.tgz" | sha256sum -c -; \ \ # https://github.com/golang/go/issues/14739#issuecomment-324767697 - export GNUPGHOME="$(mktemp -d)"; \ + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ # https://www.google.com/linuxrepositories/ - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ + # let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ gpg --batch --verify go.tgz.asc go.tgz; \ gpgconf --kill all; \ rm -rf "$GNUPGHOME" go.tgz.asc; \ @@ -90,17 +99,17 @@ RUN set -eux; \ tar -C /usr/local -xzf go.tgz; \ rm go.tgz; \ \ - if [ "$arch" = 'src' ]; then \ + if [ -n "$build" ]; then \ savedAptMark="$(apt-mark showmanual)"; \ apt-get update; \ apt-get install -y --no-install-recommends golang-go; \ \ - goEnv="$(go env | sed -rn -e '/^GO(OS|ARCH|ARM|386)=/s//export \0/p')"; \ - eval "$goEnv"; \ - [ -n "$GOOS" ]; \ - [ -n "$GOARCH" ]; \ + export GOCACHE='/tmp/gocache'; \ + \ ( \ cd /usr/local/go/src; \ + # set GOROOT_BOOTSTRAP + GOHOST* such that we can build Go successfully + export GOROOT_BOOTSTRAP="$(go env GOROOT)" GOHOSTOS="$GOOS" GOHOSTARCH="$GOARCH"; \ ./make.bash; \ ); \ \ @@ -109,11 +118,6 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ - # pre-compile the standard library, just like the official binary release tarballs do - go install std; \ - # go install: -race is only supported on linux/amd64, linux/ppc64le, linux/arm64, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64 - # go install -race std; \ - \ # remove a few intermediate / bootstrapping files the official binary release tarballs do not contain rm -rf \ /usr/local/go/pkg/*/cmd \ @@ -122,11 +126,16 @@ RUN set -eux; \ /usr/local/go/pkg/tool/*/api \ /usr/local/go/pkg/tool/*/go_bootstrap \ /usr/local/go/src/cmd/dist/dist \ + "$GOCACHE" \ ; \ fi; \ \ go version +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + ENV GOPATH /go ENV PATH $GOPATH/bin:$PATH RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" \ diff --git a/pypyr-go/hooks/test b/pypyr-go/hooks/test index d8337b6..65358dc 100755 --- a/pypyr-go/hooks/test +++ b/pypyr-go/hooks/test @@ -1,6 +1,6 @@ #!/bin/bash -xe -EXPECTED_GO='go version go1.15.7' +EXPECTED_GO='go version go1.21.4' EXPECTED_PYPYR='pypyr 5.9.1' # this runs on docker cloud as part of automated build, where IMAGE_NAME is set diff --git a/pypyr-go/tags b/pypyr-go/tags index 3ba892e..11fcb57 100644 --- a/pypyr-go/tags +++ b/pypyr-go/tags @@ -1 +1 @@ -pypyr5.9.1-go1.15.7 +pypyr5.9.1-go1.21.4 diff --git a/pypyr-ops/Dockerfile b/pypyr-ops/Dockerfile index 3a4f47c..11420f8 100644 --- a/pypyr-ops/Dockerfile +++ b/pypyr-ops/Dockerfile @@ -6,27 +6,27 @@ # build me like this from repo root: # docker build -t pypyr/pypyr-ops -t pypyr/pypyr-ops:latest -t pypyr/pypyr-ops:1.0.0 -f pypyr-ops/Dockerfile . -FROM pypyr/pypyr-go:pypyr5.9.1-go1.15.7 +FROM pypyr/pypyr-go:pypyr5.9.1-go1.21.4 -ARG terraformversion=0.14.5 +ARG terraformversion=1.6.3 -ARG awsversion=1.18.223 +ARG awsversion=1.29.80 -ARG kubeversion=v1.20.2 +ARG kubeversion=v1.28.3 -ARG helmversion=v3.5.1 +ARG helmversion=v3.13.0 -ARG dockerversion=20.10.3 +ARG dockerversion=24.0.7 -ARG dockercompose_version=1.28.2 +ARG dockercompose_version=v2.23.0 -ARG NODE_VERSION=14.15.4 +ARG NODE_VERSION=21.1.0 -ARG NPM_VERSION=6.14.11 +ARG NPM_VERSION=10.2.3 -ARG YARN_VERSION=1.22.10 +ARG YARN_VERSION=1.22.19 -ARG spinversion=1.20.0 +ARG spinversion=1.30.0 RUN apt-get update && apt-get install -y apt-transport-https &&\ wget https://releases.hashicorp.com/terraform/${terraformversion}/terraform_${terraformversion}_linux_amd64.zip && \ @@ -43,8 +43,10 @@ RUN apt-get update && apt-get install -y apt-transport-https &&\ mv ./docker/* /usr/local/bin/ && \ rm -f docker-${dockerversion}.tgz && \ rm -rf docker/ && \ - pip install docker-compose==${dockercompose_version} && \ - curl -o get-helm https://raw.githubusercontent.com/helm/helm/master/scripts/get && bash ./get-helm --version ${helmversion} && rm -f ./get-helm && \ + mkdir -p /usr/local/lib/docker/cli-plugins && \ + curl -SL https://github.com/docker/compose/releases/download/${dockercompose_version}/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose && \ + chmod +x /usr/local/bin/docker-compose && \ + curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && bash ./get_helm.sh --version ${helmversion} && rm -f ./get_helm.sh && \ curl -LO https://storage.googleapis.com/spinnaker-artifacts/spin/${spinversion}/linux/amd64/spin && \ chmod +x spin && \ mv spin /usr/local/bin/spin && \ @@ -59,28 +61,31 @@ RUN apt-get update && apt-get install -y apt-transport-https &&\ i386) ARCH='x86';; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ + # use pre-existing gpg directory, see https://github.com/nodejs/docker-node/pull/1895#issuecomment-1550389150 + && export GNUPGHOME="$(mktemp -d)" \ # gpg keys listed at https://github.com/nodejs/node#release-keys && set -ex \ && for key in \ 4ED778F539E3634C779C87C6D7062848A1AB005C \ - 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ - 1C050899334244A8AF75E53792EF661D867B9DFA \ - 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \ + 141F07595B7B3FFE74309A937405533BE57C7D57 \ + 74F12602B6F1C4E913FAA37AD3A89613643B6201 \ + DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 \ + 61FC681DFB92A079F1685E77973F295594EC4689 \ 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \ C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ + 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \ C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \ - DD8F2338BAE7501E3DD5AC78C273792F7D83545D \ - A48C2BEE680E841632CD4E44F07496B3EB3C1762 \ 108F52B48DB57BB0CC439B2997B01419BD92F80A \ - B9E2F5981AA6E0CD28160D9FF13993A75599653C \ + A363A499291CBBC940DD62E41F10027AF002F8B0 \ ; do \ - gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \ - gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \ - gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \ + gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \ done \ && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \ && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \ + && gpgconf --kill all \ + && rm -rf "$GNUPGHOME" \ && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \ diff --git a/pypyr-ops/history.md b/pypyr-ops/history.md index cf978a2..e86d19e 100644 --- a/pypyr-ops/history.md +++ b/pypyr-ops/history.md @@ -1,5 +1,21 @@ # changelog +## 7.0.0 2023/11/08 +| tool | version | link | +| --------------------- |-------------------|------------------------------------------------------------------------| +| pypyr | 5.9.1 | https://pypyr.io | +| go | 1.21.4 | https://golang.org/doc/go1.15 | +| helm | 3.13.0 | https://github.com/helm | +| terraform | 1.6.3 | https://github.com/hashicorp/terraform/blob/master/CHANGELOG.md | +| awscli | 1.29.80 | https://aws.amazon.com/cli/ | +| kubectl | 1.28.3 | https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.20.md| +| docker | 20.10.3 | https://www.docker.com/ | +| docker-compose | 2.23.0 | https://www.docker.com/ | +| nodejs | 21.1.0 | https://nodejs.org/en/ | +| npm | 10.2.3 | https://www.npmjs.com/ | +| yarn | 1.22.19 | https://yarnpkg.com/en/ | +| spin | 1.20.0 | https://www.spinnaker.io/guides/spin/cli/ | + ## 6.4.0 2021/02/01 | tool | version | link | | --------------------- |-------------------|------------------------------------------------------------------------| diff --git a/pypyr-ops/hooks/test b/pypyr-ops/hooks/test index 18c682f..e3d1952 100755 --- a/pypyr-ops/hooks/test +++ b/pypyr-ops/hooks/test @@ -1,17 +1,17 @@ #!/bin/bash -xe -EXPECTED_GO='go version go1.15.7' -EXPECTED_HELM='v3.5.1' +EXPECTED_GO='go version go1.21.4' +EXPECTED_HELM='v3.13.0' EXPECTED_PYPYR='pypyr 5.9.1' -EXPECTED_TERRAFORM='Terraform v0.14.5' -EXPECTED_AWS='aws-cli/1.18.223' -EXPECTED_DOCKER='20.10.3' -EXPECTED_DOCKER_COMPOSE='1.28.2' -EXPECTED_KUBECTL='v1.20.2' -EXPECTED_SPIN='version 1.20.0' -EXPECTED_NODE='v14.15.4' -EXPECTED_NPM='6.14.11' -EXPECTED_YARN='1.22.10' +EXPECTED_TERRAFORM='Terraform v1.6.3' +EXPECTED_AWS='aws-cli/1.29.80' +EXPECTED_DOCKER='24.0.7' +EXPECTED_DOCKER_COMPOSE='2.23.0' +EXPECTED_KUBECTL='v1.28.3' +EXPECTED_SPIN='version 1.30.0' +EXPECTED_NODE='v21.1.0' +EXPECTED_NPM='10.2.3' +EXPECTED_YARN='1.22.19' # this runs on docker cloud as part of automated build, where IMAGE_NAME is set # for you. For local runs, initialize using vars from ops/deploy.sh, which @@ -44,7 +44,7 @@ DOCKERVER=$(docker run --entrypoint docker ${IMAGE_NAME} --version) # returns something like: # docker-compose version 1.23.2, build 1110ad01 -DOCKER_COMPOSE_VER=$(docker run --entrypoint docker-compose ${IMAGE_NAME} --version) +DOCKER_COMPOSE_VER=$(docker run --entrypoint docker-compose ${IMAGE_NAME} version) # returns something like: # Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.0", @@ -54,7 +54,7 @@ KUBECTLVER=$(docker run --entrypoint kubectl ${IMAGE_NAME} version --client) # returns something like: # version 1.5.3 -SPINVER=$(docker run --entrypoint spin ${IMAGE_NAME} --version) +SPINVER=$(docker run --platform linux/x86_64 --entrypoint spin ${IMAGE_NAME} --version) NODEVER=$(docker run --entrypoint node ${IMAGE_NAME} -v) NPMVER=$(docker run --entrypoint npm ${IMAGE_NAME} -v) diff --git a/pypyr-ops/tags b/pypyr-ops/tags index 19b860c..66ce77b 100644 --- a/pypyr-ops/tags +++ b/pypyr-ops/tags @@ -1 +1 @@ -6.4.0 +7.0.0