Dockerfile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. FROM debian:buster-slim
  2. # > cni.go:364] [...] exec: "iptables": executable file not found in $PATH
  3. # > docker_sandbox.go:394] failed to read pod IP from plugin/docker: networkPlugin cni [...]: unexpected command output nsenter: failed to execute ip: No such file or directory
  4. RUN apt-get update && apt-get install --yes --no-install-recommends \
  5. ca-certificates \
  6. curl \
  7. iproute2 \
  8. iptables
  9. # k8s.gcr.io/kube-proxy:v1.17.0 uses legacy iptables
  10. RUN update-alternatives --set iptables /usr/sbin/iptables-legacy
  11. # https://github.com/kubernetes/kubernetes/blob/v1.17.0/pkg/kubelet/dockershim/network/kubenet/kubenet_linux.go#L88
  12. ARG CNI_PLUGINS_VERSION=v0.8.5
  13. ARG CNI_BIN_DIR=/opt/cni/bin
  14. ARG CNI_PLUGINS="\
  15. ./bridge \
  16. ./host-local \
  17. ./loopback \
  18. "
  19. RUN mkdir --parents $CNI_BIN_DIR \
  20. && curl --location https://github.com/containernetworking/plugins/releases/download/$CNI_PLUGINS_VERSION/cni-plugins-linux-amd64-$CNI_PLUGINS_VERSION.tgz \
  21. | tar --ungzip --extract --verbose --directory=$CNI_BIN_DIR -- $CNI_PLUGINS \
  22. && ls -l --human-readable --all $CNI_BIN_DIR
  23. ARG KUBERNETES_VERSION=v1.17.0
  24. RUN curl --location https://dl.k8s.io/$KUBERNETES_VERSION/kubernetes-node-linux-amd64.tar.gz \
  25. | tar --ungzip --extract --verbose --directory=/usr/local/bin --strip-components=3 kubernetes/node/bin/kubelet
  26. #RUN apt-get install --yes --no-install-recommends strace
  27. #ENTRYPOINT ["strace", "-f"]
  28. # --healthz-port
  29. HEALTHCHECK CMD [ "$(curl --silent --show-error http://localhost:10248/healthz)" = "ok" ] || exit 1