-
Notifications
You must be signed in to change notification settings - Fork 38
/
Dockerfile.dapper
36 lines (28 loc) · 1.35 KB
/
Dockerfile.dapper
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM registry.suse.com/bci/golang:1.22
ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH
RUN zypper -n rm container-suseconnect && \
zypper -n install curl docker gzip tar wget awk zip unzip
# install goimports
RUN GO111MODULE=on go install golang.org/x/tools/cmd/[email protected]
## install golangci-lint
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.1
# The docker version in dapper is too old to have buildx. Install it manually.
RUN wget --quiet https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-${ARCH} && \
wget --quiet https://releases.hashicorp.com/terraform/0.13.4/terraform_0.13.4_linux_${ARCH}.zip && \
chmod +x buildx-v0.13.1.linux-${ARCH} && \
unzip terraform_0.13.4_linux_${ARCH}.zip && \
mv buildx-v0.13.1.linux-${ARCH} /usr/local/bin/buildx && \
mv terraform /usr/local/bin/terraform
ENV DAPPER_RUN_ARGS="--network host -v /run/containerd/containerd.sock:/run/containerd/containerd.sock"
ENV DAPPER_ENV REPO TAG DRONE_TAG
ENV DAPPER_SOURCE /go/src/github.com/harvester/terraform-provider-harvester
ENV DAPPER_OUTPUT ./bin ./dist
ENV DAPPER_DOCKER_SOCKET true
ENV HOME ${DAPPER_SOURCE}
COPY go.mod ${DAPPER_SOURCE}/go.mod
COPY go.sum ${DAPPER_SOURCE}/go.sum
WORKDIR ${DAPPER_SOURCE}
RUN go mod download
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]