Skip to content

Commit 44ccc7d

Browse files
authored
Add python2 packages to dev container (#525)
1 parent d7a9987 commit 44ccc7d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.devcontainer/Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
88
ARG NODE_VERSION="none"
99
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
1010

11-
RUN /usr/local/bin/python3 -m pip install --upgrade pip
11+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
12+
&& apt-get -y install --no-install-recommends tig python2.7 python2.7-dev
1213

14+
RUN /usr/local/bin/python3 -m pip install --upgrade pip
1315
COPY requirements.txt /tmp/pip-tmp/
1416
COPY dev-requirements*.txt /tmp/pip-tmp/
15-
RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/dev-requirements-py3.txt && rm -rf /tmp/pip-tmp
16-
17-
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
18-
&& apt-get -y install --no-install-recommends tig python2.7 python2.7-dev
17+
RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/dev-requirements-py3.txt \
18+
&& wget https://bootstrap.pypa.io/pip/2.7/get-pip.py \
19+
&& python2.7 get-pip.py \
20+
&& rm get-pip.py \
21+
&& python2.7 -m pip install -r /tmp/pip-tmp/dev-requirements-py2.txt \
22+
&& rm -rf /tmp/pip-tmp
1923

2024
# [Optional] Uncomment this line to install global node packages.
2125
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

0 commit comments

Comments
 (0)