-
Notifications
You must be signed in to change notification settings - Fork 119
/
Dockerfile.dapper
98 lines (85 loc) · 3.65 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
ARG RANCHER_VERSION=v2.9-head
FROM rancher/rancher:$RANCHER_VERSION as rancher
FROM registry.suse.com/bci/golang:1.22
RUN mkdir -p /var/lib/rancher
COPY --from=rancher /var/lib/rancher /var/lib/rancher
# config and k3s.yaml
#RUN mkdir -p /root/.kube
#COPY --from=rancher /root/.kube /root/.kube
COPY --from=rancher /run /run
RUN mkdir -p /usr/share/rancher
COPY --from=rancher /usr/share/rancher /usr/share/rancher
COPY --from=rancher/k3s:v1.30.1-k3s1 \
/bin/blkid \
/bin/bandwidth \
/bin/cni \
/bin/conntrack \
/bin/containerd \
/bin/containerd-shim-runc-v2 \
/bin/ethtool \
/bin/firewall \
/bin/ip \
/bin/ipset \
/bin/k3s \
/bin/losetup \
/bin/pigz \
/bin/runc \
/bin/which \
/bin/aux/xtables-legacy-multi \
/usr/bin/
COPY --from=rancher \
/usr/bin/rancher \
/usr/bin/rancher-helm \
/usr/bin/rancher-tiller \
/usr/bin/rancher-machine \
/usr/bin/
RUN mkdir -p /go/src/github.com/rancher/kontainer-driver-metadata/.kube
RUN ln -s /usr/bin/cni /usr/bin/bridge && \
ln -s /usr/bin/cni /usr/bin/flannel && \
ln -s /usr/bin/cni /usr/bin/host-local && \
ln -s /usr/bin/cni /usr/bin/loopback && \
ln -s /usr/bin/cni /usr/bin/portmap && \
ln -s /usr/bin/k3s /usr/bin/crictl && \
ln -s /usr/bin/k3s /usr/bin/ctr && \
ln -s /usr/bin/k3s /usr/bin/k3s-agent && \
ln -s /usr/bin/k3s /usr/bin/k3s-etcd-snapshot && \
ln -s /usr/bin/k3s /usr/bin/k3s-server && \
ln -s /usr/bin/k3s /usr/bin/kubectl && \
ln -s /usr/bin/pigz /usr/bin/unpigz && \
ln -s /usr/bin/xtables-legacy-multi /usr/bin/iptables && \
ln -s /usr/bin/xtables-legacy-multi /usr/bin/iptables-save && \
ln -s /usr/bin/xtables-legacy-multi /usr/bin/iptables-restore && \
ln -s /usr/bin/xtables-legacy-multi /usr/bin/iptables-translate && \
ln -s /usr/bin/xtables-legacy-multi /usr/bin/ip6tables && \
ln -s /usr/bin/xtables-legacy-multi /usr/bin/ip6tables-save && \
ln -s /usr/bin/xtables-legacy-multi /usr/bin/ip6tables-restore && \
ln -s /usr/bin/xtables-legacy-multi /usr/bin/ip6tables-translate && \
ln -s /etc/rancher/k3s/k3s.yaml /go/src/github.com/rancher/kontainer-driver-metadata/.kube/k3s.yaml
ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH
ENV GOLANGCI_LINT v1.59.0
RUN zypper -n install git docker vim less file curl wget jq awk && rpm -e --nodeps --noscripts containerd
RUN go install golang.org/x/tools/cmd/goimports@latest
RUN if [[ "${ARCH}" == "amd64" ]]; then \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s ${GOLANGCI_LINT}; \
curl -sL https://github.com/rancher/wharfie/releases/download/v0.6.1/wharfie-amd64 -o /bin/wharfie && chmod +x /bin/wharfie; \
curl -sL https://github.com/regclient/regclient/releases/download/v0.7.1/regsync-linux-amd64 -o /bin/regsync && chmod +x /bin/regsync; \
fi
ENV YQ_VERSION v4.41.1
RUN wget -q https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${ARCH}.tar.gz -O - | tar xz && mv yq_linux_${ARCH} /usr/bin/yq
ENV DAPPER_ENV REPO TAG CI \
PREV_COMMIT_PR_SHA PREV_COMMIT_PUSH_SHA GITHUB_EVENT_NAME GITHUB_RUN_NUMBER GITHUB_REF_TYPE GITHUB_REF_NAME \
REGISTRY_ENDPOINT REGISTRY_USERNAME REGISTRY_PASSWORD \
V2PROV_TEST_DIST V2PROV_TEST_RUN_REGEX KDM_TEST_K8S_MINOR DEBUG
ENV DAPPER_SOURCE /go/src/github.com/rancher/kontainer-driver-metadata
ENV DAPPER_DOCKER_SOCKET true
ARG CI
ARG GITHUB_RUN_NUMBER
ENV DAPPER_RUN_ARGS "--privileged --label CI=${CI} --label DRONE_BUILD_NUMBER=${GITHUB_RUN_NUMBER}"
ENV HOME ${DAPPER_SOURCE}
ENV GOPATH /go
VOLUME /var/lib/rancher
VOLUME /var/lib/kubelet
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]