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.

33 lines
1.4 KiB

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