|
| 1 | +FROM fedora:30 |
| 2 | + |
| 3 | +ENV DAPPER_HOST_ARCH=amd64 |
| 4 | +ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} \ |
| 5 | + LINT_VERSION=v1.16.0 \ |
| 6 | + HELM_VERSION=v2.14.1 \ |
| 7 | + KIND_VERSION=v0.6.1 \ |
| 8 | + KUBEFED_VERSION=0.1.0-rc3 |
| 9 | + |
| 10 | +ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH=GOLANG_ARCH_${ARCH} \ |
| 11 | + GOPATH=/go GO111MODULE=on PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash GOFLAGS=-mod=vendor \ |
| 12 | + GOPROXY=https://proxy.golang.org |
| 13 | + |
| 14 | +# Requirements: |
| 15 | +# Component | Usage |
| 16 | +# ----------------------------------------------------------- |
| 17 | +# gcc | ginkgo |
| 18 | +# git | find the workspace root |
| 19 | +# curl | download other tools |
| 20 | +# moby-engine | Dapper (Docker) |
| 21 | +# golang | build |
| 22 | +# kubectl | e2e tests (in kubernetes-client) |
| 23 | +# golangci-lint | code linting |
| 24 | +# helm | e2e tests |
| 25 | +# kubefedctl | e2e tests |
| 26 | +# kind | e2e tests |
| 27 | +# ginkgo | tests |
| 28 | +# goimports | code formatting |
| 29 | +# make | OLM installation |
| 30 | +# findutils | e2e cleanup (xargs) |
| 31 | +# upx | binary compression |
| 32 | +# jq | JSON processing (GitHub API) |
| 33 | +# diffutils | required for goimports |
| 34 | +RUN dnf -y distrosync --nodocs --setopt=install_weak_deps=False && \ |
| 35 | + dnf -y install --nodocs --setopt=install_weak_deps=False gcc git-core curl moby-engine make golang kubernetes-client findutils upx jq && \ |
| 36 | + dnf -y remove acl dnf-yum langpacks-en libevent libsemanage libsss_idmap libxcrypt-compat mkpasswd openssl python3-pip python3-setuptools \ |
| 37 | + sssd-client unbound-libs whois-nls && \ |
| 38 | + rpm -e --nodeps selinux-policy-targeted && \ |
| 39 | + dnf -y clean all && \ |
| 40 | + curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin ${LINT_VERSION} && \ |
| 41 | + curl "https://storage.googleapis.com/kubernetes-helm/helm-${HELM_VERSION}-linux-${ARCH}.tar.gz" | tar -xzf - && \ |
| 42 | + mv linux-${ARCH}/helm /usr/bin/ && chmod a+x /usr/bin/helm && rm -rf linux-${ARCH} && \ |
| 43 | + curl -L "https://github.com/kubernetes-sigs/kubefed/releases/download/v${KUBEFED_VERSION}/kubefedctl-${KUBEFED_VERSION}-linux-${ARCH}.tgz" | tar -xzf - && \ |
| 44 | + mv kubefedctl /usr/bin/ && chmod a+x /usr/bin/kubefedctl && \ |
| 45 | + curl -Lo /usr/bin/kind "https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-${ARCH}" && chmod a+x /usr/bin/kind && \ |
| 46 | + GOFLAGS="" go get -v github.com/onsi/ginkgo/ginkgo && \ |
| 47 | + GOFLAGS="" go get -v golang.org/x/tools/cmd/goimports && \ |
| 48 | + upx /go/bin/ginkgo /go/bin/goimports /go/bin/golangci-lint /usr/bin/containerd /usr/bin/docker /usr/bin/dockerd /usr/bin/helm /usr/bin/kubectl \ |
| 49 | + /usr/bin/kubefedctl && \ |
| 50 | + ln -f /usr/bin/kubectl /usr/bin/hyperkube |
| 51 | + |
| 52 | +# Copy CI deployment scripts into image to share with all submariner-io/* projects |
| 53 | +# TODO: uncomment when we have the scripts |
| 54 | +#WORKDIR /opt/kind-e2e |
| 55 | +#COPY scripts/kind-e2e/ . |
0 commit comments