bump go 1.20.7 && install git for p4 base golang image (#19138)

upadte docker file

Signed-off-by: yminer <yminer@vmware.com>
This commit is contained in:
MinerYang 2023-08-14 10:55:23 +08:00 committed by GitHub
parent 36c452b7e3
commit adf8c73b3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 31 additions and 17 deletions

View File

@ -36,7 +36,7 @@ jobs:
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20.6
go-version: 1.20.7
id: go
- uses: actions/checkout@v3
with:
@ -97,7 +97,7 @@ jobs:
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20.6
go-version: 1.20.7
id: go
- uses: actions/checkout@v3
with:
@ -152,7 +152,7 @@ jobs:
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20.6
go-version: 1.20.7
id: go
- uses: actions/checkout@v3
with:
@ -207,7 +207,7 @@ jobs:
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20.6
go-version: 1.20.7
id: go
- uses: actions/checkout@v3
with:
@ -260,7 +260,7 @@ jobs:
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20.6
go-version: 1.20.7
id: go
- uses: actions/checkout@v3
with:

View File

@ -26,7 +26,7 @@ jobs:
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20.6
go-version: 1.20.7
id: go
- name: Setup Docker
uses: docker-practice/actions-setup-docker@master

View File

@ -28,7 +28,7 @@ jobs:
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20.6
go-version: 1.20.7
id: go
- uses: actions/checkout@v3
with:

View File

@ -165,7 +165,7 @@ Harbor backend is written in [Go](http://golang.org/). If you don't have a Harbo
| 2.5 | 1.17.7 |
| 2.6 | 1.18.6 |
| 2.7 | 1.19.4 |
| 2.8 | 1.20.6 |
| 2.8 | 1.20.7 |
Ensure your GOPATH and PATH have been configured in accordance with the Go environment instructions.

View File

@ -145,7 +145,7 @@ GOINSTALL=$(GOCMD) install
GOTEST=$(GOCMD) test
GODEP=$(GOTEST) -i
GOFMT=gofmt -w
GOVERSION=1.20.6
GOVERSION=1.20.7
GOBUILDIMAGE=goharbor/golang:$(GOVERSION)
PUSHGOIMAGE=false
GOBUILDPATHINCONTAINER=/harbor

View File

@ -2,13 +2,29 @@ FROM photon:4.0
ARG GOVERSION
# install cgo-related dependencies && git
# official golang build from standard Debian, while photon os do not install git as default
RUN tdnf install build-essential git gpg -y
ENV PATH /usr/local/go/bin:$PATH
ENV GOLANG_VERSION ${GOVERSION}
RUN set eux; \
url="https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz"; \
sha256="f0a87f1bcae91c4b69f8dc2bc6d7e6bfcd7524fceec130af525058c0c17b1b44"; \
wget -O go.tgz.asc "$url.asc"; \
wget -O go.tgz "$url"; \
echo "$sha256 *go.tgz" | sha256sum -c -; \
# https://github.com/golang/go/issues/14739#issuecomment-324767697
GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \
# https://www.google.com/linuxrepositories/
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; \
tar -C /usr/local -xzf go.tgz; \
rm go.tgz; \
go version
@ -16,6 +32,4 @@ RUN set eux; \
ENV GOPATH /go
ENV PATH $GOPATH/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH"
WORKDIR $GOPATH
RUN tdnf install make libstdc++ -y
WORKDIR $GOPATH

View File

@ -1,4 +1,4 @@
FROM goharbor/golang:1.20.6
FROM goharbor/golang:1.20.7
ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution
ENV BUILDTAGS include_oss include_gcs

View File

@ -1,4 +1,4 @@
FROM goharbor/golang:1.20.6
FROM goharbor/golang:1.20.7
ADD . /go/src/github.com/aquasecurity/harbor-scanner-trivy/
WORKDIR /go/src/github.com/aquasecurity/harbor-scanner-trivy/

View File

@ -19,7 +19,7 @@ TEMP=$(mktemp -d ${TMPDIR-/tmp}/trivy-adapter.XXXXXX)
git clone https://github.com/aquasecurity/harbor-scanner-trivy.git $TEMP
cd $TEMP; git checkout $VERSION; cd -
echo "Building Trivy adapter binary based on goharbor/golang:1.20.6..."
echo "Building Trivy adapter binary based on goharbor/golang:1.20.7..."
cp Dockerfile.binary $TEMP
docker build -f $TEMP/Dockerfile.binary -t trivy-adapter-golang $TEMP

View File

@ -3,5 +3,5 @@ set -x
set -e
sudo make package_online GOBUILDTAGS="include_oss include_gcs" VERSIONTAG=dev-gitaction PKGVERSIONTAG=dev-gitaction UIVERSIONTAG=dev-gitaction GOBUILDIMAGE=goharbor/golang:1.20.6 COMPILETAG=compile_golangimage NOTARYFLAG=true TRIVYFLAG=true HTTPPROXY= PULL_BASE_FROM_DOCKERHUB=false
sudo make package_offline GOBUILDTAGS="include_oss include_gcs" VERSIONTAG=dev-gitaction PKGVERSIONTAG=dev-gitaction UIVERSIONTAG=dev-gitaction GOBUILDIMAGE=goharbor/golang:1.20.6 COMPILETAG=compile_golangimage NOTARYFLAG=true TRIVYFLAG=true HTTPPROXY= PULL_BASE_FROM_DOCKERHUB=false
sudo make package_online GOBUILDTAGS="include_oss include_gcs" VERSIONTAG=dev-gitaction PKGVERSIONTAG=dev-gitaction UIVERSIONTAG=dev-gitaction GOBUILDIMAGE=goharbor/golang:1.20.7 COMPILETAG=compile_golangimage NOTARYFLAG=true TRIVYFLAG=true HTTPPROXY= PULL_BASE_FROM_DOCKERHUB=false
sudo make package_offline GOBUILDTAGS="include_oss include_gcs" VERSIONTAG=dev-gitaction PKGVERSIONTAG=dev-gitaction UIVERSIONTAG=dev-gitaction GOBUILDIMAGE=goharbor/golang:1.20.7 COMPILETAG=compile_golangimage NOTARYFLAG=true TRIVYFLAG=true HTTPPROXY= PULL_BASE_FROM_DOCKERHUB=false