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.

44 lines
1.6 KiB

  1. # Use imutable image tags rather than mutable tags (like ubuntu:22.04)
  2. FROM ubuntu:jammy-20230308
  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. PYTHONDONTWRITEBYTECODE=1
  10. WORKDIR /kubespray
  11. COPY *.yml ./
  12. COPY *.cfg ./
  13. COPY roles ./roles
  14. COPY contrib ./contrib
  15. COPY inventory ./inventory
  16. COPY library ./library
  17. COPY extra_playbooks ./extra_playbooks
  18. COPY playbooks ./playbooks
  19. COPY plugins ./plugins
  20. RUN apt update -q \
  21. && apt install -yq --no-install-recommends \
  22. curl \
  23. python3 \
  24. python3-pip \
  25. sshpass \
  26. vim \
  27. rsync \
  28. openssh-client \
  29. && pip install --no-compile --no-cache-dir \
  30. ansible==5.7.1 \
  31. ansible-core==2.12.5 \
  32. cryptography==3.4.8 \
  33. jinja2==3.1.2 \
  34. netaddr==0.8.0 \
  35. jmespath==1.0.1 \
  36. MarkupSafe==2.1.2 \
  37. ruamel.yaml==0.17.21 \
  38. && KUBE_VERSION=$(sed -n 's/^kube_version: //p' roles/kubespray-defaults/defaults/main.yaml) \
  39. && curl -L https://dl.k8s.io/release/$KUBE_VERSION/bin/linux/$(dpkg --print-architecture)/kubectl -o /usr/local/bin/kubectl \
  40. && echo $(curl -L https://dl.k8s.io/release/$KUBE_VERSION/bin/linux/$(dpkg --print-architecture)/kubectl.sha256) /usr/local/bin/kubectl | sha256sum --check \
  41. && chmod a+x /usr/local/bin/kubectl \
  42. && rm -rf /var/lib/apt/lists/* /var/log/* \
  43. && find /usr -type d -name '*__pycache__' -prune -exec rm -rf {} \;