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.5 KiB

  1. # Use imutable image tags rather than mutable tags (like ubuntu:20.04)
  2. FROM ubuntu:focal-20220316
  3. ARG TZ=Etc/UTC
  4. RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
  5. RUN apt update -y \
  6. && apt install -y \
  7. libssl-dev python3-dev sshpass apt-transport-https jq moreutils \
  8. ca-certificates curl gnupg2 software-properties-common python3-pip unzip rsync git \
  9. && rm -rf /var/lib/apt/lists/*
  10. RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
  11. && add-apt-repository \
  12. "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
  13. $(lsb_release -cs) \
  14. stable" \
  15. && apt update -y && apt-get install --no-install-recommends -y docker-ce \
  16. && rm -rf /var/lib/apt/lists/*
  17. # Some tools like yamllint need this
  18. # Pip needs this as well at the moment to install ansible
  19. # (and potentially other packages)
  20. # See: https://github.com/pypa/pip/issues/10219
  21. ENV LANG=C.UTF-8
  22. WORKDIR /kubespray
  23. COPY . .
  24. RUN /usr/bin/python3 -m pip install --no-cache-dir pip -U \
  25. && /usr/bin/python3 -m pip install --no-cache-dir -r tests/requirements.txt \
  26. && python3 -m pip install --no-cache-dir -r requirements.txt \
  27. && update-alternatives --install /usr/bin/python python /usr/bin/python3 1
  28. RUN 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/amd64/kubectl \
  30. && chmod a+x kubectl \
  31. && mv kubectl /usr/local/bin/kubectl