This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
/
Dockerfile.dapper
67 lines (64 loc) · 2.76 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM golang:1.13.12-buster
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
xz-utils \
unzip \
netcat \
&& rm -rf /var/lib/apt/lists/*
# -- for make rules
## install docker client
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg \
&& rm -rf /var/lib/apt/lists/*; \
\
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - >/dev/null; \
echo "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/debian buster stable" > /etc/apt/sources.list.d/docker.list; \
\
apt-get update -qq && apt-get install -y --no-install-recommends \
docker-ce-cli=5:19.03.* \
&& rm -rf /var/lib/apt/lists/*; \
docker --version
## install kubectl
RUN curl -fL "https://storage.googleapis.com/kubernetes-release/release/v1.18.2/bin/$(go env GOOS)/$(go env GOARCH)/kubectl" -o /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl; \
kubectl version --short --client
## install golangci-lint
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)/bin" v1.27.0; \
golangci-lint --version; \
fi
## install protoc & generate
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
GO111MODULE=on go get github.com/gogo/protobuf/protoc-gen-gogofaster@v1.3.1; \
curl -sSfL "https://github.com/protocolbuffers/protobuf/releases/download/v3.11.3/protoc-3.11.3-linux-x86_64.zip" >/tmp/protoc.zip && unzip /tmp/protoc.zip -d /usr/local; rm -f /tmp/protoc.zip; \
protoc --version; \
fi
## install mockgen
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
GO111MODULE=on go get github.com/golang/mock/mockgen@v1.4.3; \
mockgen --version; \
fi
## install controller-gen
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
GO111MODULE=on go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.3.0; \
controller-gen --version; \
fi
## install ginkgo
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
GO111MODULE=on go get github.com/onsi/ginkgo/ginkgo@v1.13.0; \
ginkgo version; \
fi
# -- for make rules
# -- for dapper
ENV DAPPER_RUN_ARGS --privileged --network host
ENV GO111MODULE=off
ENV CROSS=false
ENV DAPPER_ENV CROSS CLUSTER_TYPE DOCKER_USERNAME DOCKER_PASSWORD WITHOUT_MANIFEST ONLY_MANIFEST IGNORE_MISSING DRONE_TAG REPO TAG OS ARCH IMAGE_NAME DIRTY_CHECK
ENV DAPPER_SOURCE /go/src/github.com/rancher/octopus/
ENV DAPPER_OUTPUT ./bin ./dist ./deploy ./pkg/adaptor/api ./api
ENV DAPPER_DOCKER_SOCKET true
ENV HOME ${DAPPER_SOURCE}
# -- for dapper
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["make", "-se", "octopus"]