From c8ba3e6b4cda36c7d6db7eec31a814d641f78798 Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Sat, 9 Feb 2019 20:52:34 +0100 Subject: [PATCH] build: add python/pip/pipenv to Dockerfile Closes #3152 --- Dockerfile | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 260db40730..74aa8a9732 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,13 +9,13 @@ ENV DEBIAN_FRONTEND noninteractive ENV LC_ALL C.UTF-8 ENV LANG C.UTF-8 -RUN apt-get update && apt-get install -y gpg curl wget unzip xz-utils git openssh-client && apt-get clean -y +RUN apt-get update && apt-get install -y gpg curl wget unzip xz-utils git openssh-client bsdtar && apt-get clean -y ## Node.js # START copy Node.js from https://github.com/nodejs/docker-node/blob/master/10/jessie/Dockerfile -ENV NODE_VERSION 10.15.0 +ENV NODE_VERSION 10.15.1 RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ && case "${dpkgArch##*-}" in \ @@ -50,7 +50,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \ && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \ && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ - && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ + && bsdtar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \ && ln -s /usr/local/bin/node /usr/local/bin/nodejs @@ -82,6 +82,17 @@ RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" ENV CGO_ENABLED=0 +# Python + +RUN apt-get update && apt-get install -y python3.7-dev python3-distutils && apt-get clean + +RUN rm -fr /usr/bin/python3 && ln /usr/bin/python3.7 /usr/bin/python3 +RUN ln /usr/bin/python3.7 /usr/bin/python + +# Pip + +RUN curl --silent https://bootstrap.pypa.io/get-pip.py | python + # Set up ubuntu user RUN groupadd --gid 1000 ubuntu \ @@ -91,6 +102,14 @@ RUN chmod -R a+rw /usr USER ubuntu +# Pipenv + +ENV PATH="/home/ubuntu/.local/bin:$PATH" + +RUN pip install --user pipenv + +# Yarn + ENV YARN_VERSION=1.13.0 RUN npm i -g yarn@${YARN_VERSION} -- GitLab