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.

30 lines
1.2 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 rsync \
  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. WORKDIR /kubespray
  16. COPY . .
  17. RUN /usr/bin/python3 -m pip install pip -U \
  18. && /usr/bin/python3 -m pip install -r tests/requirements.txt \
  19. && python3 -m pip install -r requirements.txt \
  20. && update-alternatives --install /usr/bin/python python /usr/bin/python3 1
  21. RUN KUBE_VERSION=$(sed -n 's/^kube_version: //p' roles/kubespray-defaults/defaults/main.yaml) \
  22. && curl -LO https://storage.googleapis.com/kubernetes-release/release/$KUBE_VERSION/bin/linux/amd64/kubectl \
  23. && chmod a+x kubectl \
  24. && mv kubectl /usr/local/bin/kubectl
  25. # Some tools like yamllint need this
  26. ENV LANG=C.UTF-8