-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (55 loc) · 1.73 KB
/
Dockerfile
File metadata and controls
65 lines (55 loc) · 1.73 KB
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
FROM linuxkit/alpine:08c8d8aa3638d035e18499a74faf50eedb8d6cf6-amd64 AS build
# When changing kubernetes_version remember to also update:
# - scripts/mk-image-cache-lst and run `make refresh-image-caches` from top-level
# - pkg/kubelet/Dockerfile
ENV kubernetes_version v1.10.3
RUN apk add -U --no-cache \
bash \
coreutils \
curl \
findutils \
git \
go \
grep \
libc-dev \
linux-headers \
make \
rsync \
&& true
ENV GOPATH=/go PATH=$PATH:/go/bin
ENV KUBERNETES_URL https://github.com/kubernetes/kubernetes.git
#ENV KUBERNETES_BRANCH pull/NNN/head
ENV KUBERNETES_COMMIT ${kubernetes_version}
RUN mkdir -p $GOPATH/src/github.com/kubernetes && \
cd $GOPATH/src/github.com/kubernetes && \
git clone $KUBERNETES_URL kubernetes
WORKDIR $GOPATH/src/github.com/kubernetes/kubernetes
RUN set -e; \
if [ -n "$KUBERNETES_BRANCH" ] ; then \
git fetch origin "$KUBERNETES_BRANCH"; \
fi; \
git checkout -q $KUBERNETES_COMMIT
RUN make WHAT="cmd/kubectl test/e2e/e2e.test vendor/github.com/onsi/ginkgo/ginkgo"
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
RUN apk add --no-cache --initdb -p /out \
alpine-baselayout \
bash \
busybox \
ca-certificates \
curl \
musl \
socat \
util-linux \
&& true
RUN cp _output/bin/kubectl /out/usr/bin/kubectl
RUN cp _output/bin/ginkgo /out/usr/bin/ginkgo
RUN cp _output/bin/e2e.test /out/usr/bin/e2e.test
# Remove apk residuals. We have a read-only rootfs, so apk is of no use.
RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache
ADD in-cluster-config.yaml /out/etc/in-cluster-config.yaml
ADD e2e.sh /out/usr/bin/e2e.sh
FROM scratch
WORKDIR /
ENV KUBECONFIG /etc/in-cluster-config.yaml
ENTRYPOINT ["/usr/bin/e2e.sh"]
COPY --from=build /out /