forked from submariner-io/submariner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.dapper
51 lines (45 loc) · 2.5 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
FROM ubuntu:16.04
# FROM arm=armhf/ubuntu:16.04
ARG DAPPER_HOST_ARCH
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} DAPPER_ENV=REPO DAPPER_ENV=TAG \
DAPPER_SOURCE=/go/src/github.com/submariner-io/submariner DAPPER_DOCKER_SOCKET=true \
TRASH_CACHE=${DAPPER_SOURCE}/.trash-cache HOME=${DAPPER_SOURCE} DAPPER_OUTPUT=output \
LINT_VERSION=v1.16.0 \
HELM_VERSION=v2.14.1 \
KIND_VERSION=v0.3.0 \
KUBEFED_VERSION=0.1.0-rc2 \
GO_VERSION=1.12.6
RUN rm -f /bin/sh && ln -s /bin/bash /bin/sh
ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH=GOLANG_ARCH_${ARCH} \
GOPATH=/go GO111MODULE=on PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash GOFLAGS=-mod=vendor
# Requirements:
# Component | Usage
# -----------------------------------------------------------
# gcc | ginkgo
# git | find the workspace root
# curl | download other tools
# docker.io | Dapper
# golang | build
# kubectl | e2e tests
# golangci-lint | code linting
# helm | e2e tests
# kubefedctl | e2e tests
# kind | e2e tests
# ginkgo | tests
# goimports | code formatting
RUN apt-get -q update && \
apt-get install -y gcc git curl docker.io && \
curl https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local && \
curl -Lo /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/${ARCH}/kubectl && \
chmod a+x /usr/bin/kubectl && \
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin ${LINT_VERSION} && \
curl "https://storage.googleapis.com/kubernetes-helm/helm-${HELM_VERSION}-linux-${ARCH}.tar.gz" | tar -xzf - && \
cp linux-${ARCH}/helm /usr/bin/ && chmod a+x /usr/bin/helm && \
curl -LO "https://github.com/kubernetes-sigs/kubefed/releases/download/v${KUBEFED_VERSION}/kubefedctl-${KUBEFED_VERSION}-linux-${ARCH}.tgz" && \
tar -xzf kubefedctl-${KUBEFED_VERSION}-linux-${ARCH}.tgz && cp kubefedctl /usr/bin/ && chmod a+x /usr/bin/kubefedctl && \
curl -Lo /usr/bin/kind "https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-${ARCH}" && chmod a+x /usr/bin/kind && \
GOFLAGS="" go get -v github.com/onsi/ginkgo/ginkgo && \
GOFLAGS="" go get -v golang.org/x/tools/cmd/goimports
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]