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.

41 lines
1.6 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. PYTHONDONTWRITEBYTECODE=1
  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 -q \
  18. && apt install -yq --no-install-recommends \
  19. curl \
  20. python3 \
  21. python3-pip \
  22. sshpass \
  23. vim \
  24. rsync \
  25. openssh-client \
  26. && pip install --no-compile --no-cache-dir \
  27. ansible==5.7.1 \
  28. ansible-core==2.12.5 \
  29. cryptography==3.4.8 \
  30. jinja2==2.11.3 \
  31. netaddr==0.7.19 \
  32. jmespath==1.0.1 \
  33. MarkupSafe==1.1.1 \
  34. ruamel.yaml==0.17.21 \
  35. && KUBE_VERSION=$(sed -n 's/^kube_version: //p' roles/kubespray-defaults/defaults/main.yaml) \
  36. && curl -L https://storage.googleapis.com/kubernetes-release/release/$KUBE_VERSION/bin/linux/$(dpkg --print-architecture)/kubectl -o /usr/local/bin/kubectl \
  37. && echo $(curl -L https://storage.googleapis.com/kubernetes-release/release/$KUBE_VERSION/bin/linux/$(dpkg --print-architecture)/kubectl.sha256) /usr/local/bin/kubectl | sha256sum --check \
  38. && chmod a+x /usr/local/bin/kubectl \
  39. && rm -rf /var/lib/apt/lists/* /var/log/* \
  40. && find / -type d -name '*__pycache__' -prune -exec rm -rf {} \;