You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.2 KiB

  1. # Use imutable image tags rather than mutable tags (like ubuntu:20.04)
  2. FROM ubuntu:focal-20220531
  3. # Some tools like yamllint need this
  4. # Pip needs this as well at the moment to install ansible
  5. # (and potentially other packages)
  6. # See: https://github.com/pypa/pip/issues/10219
  7. ENV LANG=C.UTF-8 \
  8. DEBIAN_FRONTEND=noninteractive
  9. ARG ARCH=amd64
  10. WORKDIR /kubespray
  11. COPY *yml .
  12. COPY roles ./roles
  13. COPY contrib ./contrib
  14. COPY inventory ./inventory
  15. COPY library ./library
  16. COPY extra_playbooks ./extra_playbooks
  17. RUN apt update && apt install -y --no-install-recommends \
  18. curl python3 python3-pip sshpass vim rsync openssh-client \
  19. && rm -rf /var/lib/apt/lists/* /var/log/* \
  20. && pip install --no-cache-dir \
  21. ansible==5.7.1 \
  22. ansible-core==2.12.5 \
  23. cryptography==3.4.8 \
  24. jinja2==2.11.3 \
  25. netaddr==0.7.19 \
  26. jmespath==1.0.1 \
  27. MarkupSafe==1.1.1 \
  28. ruamel.yaml==0.17.21 \
  29. && find / -type d -name '*__pycache__' -prune -exec rm -rf {} \; \
  30. && KUBE_VERSION=$(sed -n 's/^kube_version: //p' roles/kubespray-defaults/defaults/main.yaml) \
  31. && curl -L https://storage.googleapis.com/kubernetes-release/release/$KUBE_VERSION/bin/linux/$ARCH/kubectl -o /usr/local/bin/kubectl \
  32. && chmod a+x /usr/local/bin/kubectl