update Go version and parameterize Dockerfile

Signed-off-by: Brian Downs <brian.downs@gmail.com>
pull/3080/head
Brian Downs 2021-03-31 11:51:04 -07:00
parent 5ba818d788
commit 24670c7897
4 changed files with 10 additions and 8 deletions

View File

@ -188,6 +188,7 @@ steps:
environment:
GCLOUD_AUTH:
from_secret: gcloud_auth
GOLANG: golang:1.16.2-alpine3.12
commands:
- dapper ci
- echo "${DRONE_TAG}-arm" | sed -e 's/+/-/g' >.tags

View File

@ -1,4 +1,5 @@
FROM golang:1.15.8-alpine3.12
ARG GOLANG=golang:1.15.8-alpine3.12
FROM ${GOLANG}
ARG http_proxy=$http_proxy
ARG https_proxy=$https_proxy
@ -22,10 +23,8 @@ RUN if [ "$(go env GOARCH)" = "arm64" ]; then
tar -zxvf trivy_0.11.0_Linux-64bit.tar.gz && \
mv trivy /usr/local/bin; \
fi
RUN mkdir -p /go/src/golang.org/x && \
cd /go/src/golang.org/x && git clone https://github.com/golang/tools && cd tools && \
git checkout -b current aa82965741a9fecd12b026fbb3d3c6ed3231b8f8 && \
go install golang.org/x/tools/cmd/goimports && cd
# this works for both go 1.15 and 1.16
RUN GO111MODULE=on go get golang.org/x/tools/cmd/goimports@aa82965741a9fecd12b026fbb3d3c6ed3231b8f8
RUN rm -rf /go/src /go/pkg
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
@ -37,7 +36,7 @@ ENV SELINUX $SELINUX
ENV GO111MODULE off
ENV DAPPER_RUN_ARGS --privileged -v k3s-cache:/go/src/github.com/rancher/k3s/.cache -v trivy-cache:/root/.cache/trivy
ENV DAPPER_ENV REPO TAG DRONE_TAG IMAGE_NAME SKIP_VALIDATE GCLOUD_AUTH GITHUB_TOKEN
ENV DAPPER_ENV REPO TAG DRONE_TAG IMAGE_NAME SKIP_VALIDATE GCLOUD_AUTH GITHUB_TOKEN GOLANG
ENV DAPPER_SOURCE /go/src/github.com/rancher/k3s/
ENV DAPPER_OUTPUT ./bin ./dist ./build/out
ENV DAPPER_DOCKER_SOCKET true

View File

@ -1,4 +1,5 @@
FROM golang:1.15.8-alpine3.12
ARG GOLANG=golang:1.15.8-alpine3.12
FROM ${GOLANG}
COPY --from=plugins/manifest:1.2.3 /bin/* /bin/

View File

@ -1,4 +1,5 @@
FROM golang:1.15.8-alpine3.12
ARG GOLANG=golang:1.15.8-alpine3.12
FROM ${GOLANG}
RUN apk -U --no-cache add bash git gcc musl-dev docker curl jq coreutils python2 openssl