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.

36 lines
1.1 KiB

  1. # Use imutable image tags rather than mutable tags (like ubuntu:20.04)
  2. FROM ubuntu:focal-20220531
  3. ARG ARCH=amd64
  4. ARG TZ=Etc/UTC
  5. RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
  6. RUN apt update -y \
  7. && apt install -y \
  8. curl python3 python3-pip sshpass \
  9. && rm -rf /var/lib/apt/lists/*
  10. # Some tools like yamllint need this
  11. # Pip needs this as well at the moment to install ansible
  12. # (and potentially other packages)
  13. # See: https://github.com/pypa/pip/issues/10219
  14. ENV LANG=C.UTF-8
  15. WORKDIR /kubespray
  16. COPY *yml /kubespray/
  17. COPY roles /kubespray/roles
  18. COPY inventory /kubespray/inventory
  19. COPY library /kubespray/library
  20. COPY extra_playbooks /kubespray/extra_playbooks
  21. RUN python3 -m pip install --no-cache-dir \
  22. ansible==5.7.1 \
  23. ansible-core==2.12.5 \
  24. cryptography==3.4.8 \
  25. jinja2==2.11.3 \
  26. netaddr==0.7.19 \
  27. MarkupSafe==1.1.1 \
  28. && KUBE_VERSION=$(sed -n 's/^kube_version: //p' roles/kubespray-defaults/defaults/main.yaml) \
  29. && curl -LO https://storage.googleapis.com/kubernetes-release/release/$KUBE_VERSION/bin/linux/$ARCH/kubectl \
  30. && chmod a+x kubectl \
  31. && mv kubectl /usr/local/bin/kubectl