2020-09-11 17:17:35 +00:00
FROM golang:1.15.2-alpine3.12
2019-01-01 08:23:01 +00:00
2020-03-25 19:34:20 +00:00
ARG http_proxy = $http_proxy
ARG https_proxy = $https_proxy
ARG no_proxy = $no_proxy
ENV http_proxy = $http_proxy
ENV https_proxy = $https_proxy
ENV no_proxy = $no_proxy
2019-01-01 08:23:01 +00:00
RUN apk -U --no-cache add bash git gcc musl-dev docker vim less file curl wget ca-certificates jq linux-headers zlib-dev tar zip squashfs-tools npm coreutils \
2020-07-28 00:20:40 +00:00
python2 openssl-dev libffi-dev libseccomp libseccomp-dev make libuv-static sqlite-dev sqlite-static libselinux libselinux-dev zlib-dev zlib-static
2020-09-16 20:49:51 +00:00
RUN if [ " $( go env GOARCH) " = "arm64" ] ; then \
wget https://github.com/aquasecurity/trivy/releases/download/v0.11.0/trivy_0.11.0_Linux-ARM64.tar.gz && \
tar -zxvf trivy_0.11.0_Linux-ARM64.tar.gz && \
mv trivy /usr/local/bin; \
elif [ " $( go env GOARCH) " = "arm" ] ; then \
wget https://github.com/aquasecurity/trivy/releases/download/v0.11.0/trivy_0.11.0_Linux-ARM.tar.gz && \
tar -zxvf trivy_0.11.0_Linux-ARM.tar.gz && \
mv trivy /usr/local/bin; \
else \
wget https://github.com/aquasecurity/trivy/releases/download/v0.11.0/trivy_0.11.0_Linux-64bit.tar.gz && \
tar -zxvf trivy_0.11.0_Linux-64bit.tar.gz && \
mv trivy /usr/local/bin; \
2020-09-15 18:43:27 +00:00
fi
RUN trivy --download-db-only
2019-03-19 09:15:25 +00:00
RUN mkdir -p /go/src/golang.org/x && \
2020-02-28 22:39:11 +00:00
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
2019-01-22 21:14:58 +00:00
RUN rm -rf /go/src /go/pkg
2019-01-01 08:23:01 +00:00
2019-01-22 21:14:58 +00:00
ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH
2019-03-25 04:50:02 +00:00
2020-03-05 14:28:34 +00:00
RUN if [ " ${ ARCH } " = 'amd64' ] ; then \
2020-09-15 18:43:27 +00:00
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.30.0; \
2019-03-25 04:50:02 +00:00
fi
2020-02-24 20:13:59 +00:00
ARG SELINUX = true
ENV SELINUX $SELINUX
2019-11-13 06:16:53 +00:00
ENV GO111MODULE off
2020-09-18 23:13:17 +00:00
ENV DAPPER_RUN_ARGS --privileged -v k3s-cache:/go/src/github.com/rancher/k3s/.cache -v trivy-cache:/root/.cache/trivy
2019-12-23 19:07:34 +00:00
ENV DAPPER_ENV REPO TAG DRONE_TAG IMAGE_NAME SKIP_VALIDATE GCLOUD_AUTH
2019-01-09 16:54:15 +00:00
ENV DAPPER_SOURCE /go/src/github.com/rancher/k3s/
2019-02-05 18:16:16 +00:00
ENV DAPPER_OUTPUT ./bin ./dist ./build/out
2019-01-01 08:23:01 +00:00
ENV DAPPER_DOCKER_SOCKET true
ENV HOME ${ DAPPER_SOURCE }
ENV CROSS true
2019-01-09 16:54:15 +00:00
ENV STATIC_BUILD true
2019-01-01 08:23:01 +00:00
WORKDIR ${DAPPER_SOURCE}
2019-01-24 17:51:14 +00:00
ENTRYPOINT [ "./scripts/entry.sh" ]
2019-01-01 08:23:01 +00:00
CMD [ "ci" ]