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.

38 lines
1.2 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 rsync \
  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. jmespath==1.0.1 \
  28. MarkupSafe==1.1.1 \
  29. ruamel.yaml==0.17.21 \
  30. && KUBE_VERSION=$(sed -n 's/^kube_version: //p' roles/kubespray-defaults/defaults/main.yaml) \
  31. && curl -LO https://storage.googleapis.com/kubernetes-release/release/$KUBE_VERSION/bin/linux/$ARCH/kubectl \
  32. && chmod a+x kubectl \
  33. && mv kubectl /usr/local/bin/kubectl