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.

37 lines
1.5 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. libssl-dev python3-dev sshpass apt-transport-https jq moreutils \
  9. ca-certificates curl gnupg2 software-properties-common python3-pip unzip rsync git \
  10. && rm -rf /var/lib/apt/lists/*
  11. RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
  12. && add-apt-repository \
  13. "deb [arch=$ARCH] https://download.docker.com/linux/ubuntu \
  14. $(lsb_release -cs) \
  15. stable" \
  16. && apt update -y && apt-get install --no-install-recommends -y docker-ce \
  17. && rm -rf /var/lib/apt/lists/*
  18. # Some tools like yamllint need this
  19. # Pip needs this as well at the moment to install ansible
  20. # (and potentially other packages)
  21. # See: https://github.com/pypa/pip/issues/10219
  22. ENV LANG=C.UTF-8
  23. WORKDIR /kubespray
  24. COPY . .
  25. RUN /usr/bin/python3 -m pip install --no-cache-dir pip -U \
  26. && /usr/bin/python3 -m pip install --no-cache-dir -r tests/requirements.txt \
  27. && python3 -m pip install --no-cache-dir -r requirements.txt \
  28. && update-alternatives --install /usr/bin/python python /usr/bin/python3 1
  29. RUN KUBE_VERSION=$(sed -n 's/^kube_version: //p' roles/kubespray-defaults/defaults/main.yaml) \
  30. && curl -LO https://storage.googleapis.com/kubernetes-release/release/$KUBE_VERSION/bin/linux/$ARCH/kubectl \
  31. && chmod a+x kubectl \
  32. && mv kubectl /usr/local/bin/kubectl