k3s/Dockerfile.dapper

41 lines
1.6 KiB
Docker
Raw Normal View History

2019-12-10 21:47:25 +00:00
FROM golang:1.13.5-alpine3.10
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 \
2019-12-23 19:07:34 +00:00
python2 python3 py3-pip python3-dev openssl-dev libffi-dev libseccomp libseccomp-dev make libuv-static
2019-01-01 08:23:01 +00:00
RUN pip3 install 'tox==3.6.0'
RUN apk -U --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/main/ add sqlite-dev sqlite-static
RUN mkdir -p /go/src/golang.org/x && \
2019-03-25 04:50:02 +00:00
cd /go/src/golang.org/x && git clone https://github.com/golang/tools && \
2019-03-25 22:48:28 +00:00
git -C /go/src/golang.org/x/tools checkout -b current aa82965741a9fecd12b026fbb3d3c6ed3231b8f8 && \
2019-03-25 04:50:02 +00:00
go install golang.org/x/tools/cmd/goimports
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
RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.15.0; \
fi
2019-11-12 05:49:33 +00:00
ARG DQLITE=true
ENV DQLITE $DQLITE
2019-12-16 18:44:13 +00:00
COPY --from=rancher/dqlite-build:v1.2.1-r3 /dist/artifacts /usr/src/
2019-11-12 05:49:33 +00:00
RUN if [ "$DQLITE" = true ]; then \
2019-12-16 18:44:13 +00:00
tar xzf /usr/src/dqlite.tgz -C / && \
2019-11-12 05:49:33 +00:00
apk add --allow-untrusted /usr/local/packages/*.apk \
;fi
ENV GO111MODULE off
2019-02-08 20:26:41 +00:00
ENV DAPPER_RUN_ARGS --privileged -v k3s-cache:/go/src/github.com/rancher/k3s/.cache
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}
ENTRYPOINT ["./scripts/entry.sh"]
2019-01-01 08:23:01 +00:00
CMD ["ci"]