1+ # -------------------------------------------------------------------------------------------------------------
2+ # Copyright (c) Microsoft Corporation. All rights reserved.
3+ # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
4+ # -------------------------------------------------------------------------------------------------------------
5+
6+ # Python Versions
7+ # FROM python:3
8+ # Python Anaconda
9+ FROM continuumio/anaconda3
10+
11+ # Avoid warnings by switching to noninteractive
12+ ENV DEBIAN_FRONTEND=noninteractive
13+
14+ # This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
15+ # property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
16+ # will be updated to match your local UID/GID (when using the dockerFile property).
17+ # See https://aka.ms/vscode-remote/containers/non-root-user for details.
18+ ARG USERNAME=vscode
19+ ARG USER_UID=1000
20+ ARG USER_GID=$USER_UID
21+ #
22+ # Copy environment.yml (if found) to a temp locaition so we update the environment. Also
23+ # copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
24+ COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
25+
26+ # Configure apt and install packages
27+ RUN apt-get update \
28+ && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
29+ #
30+ # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
31+ && apt-get -y install git openssh-client less iproute2 procps lsb-release \
32+ #
33+ # Install Python Libraries
34+ && pip --disable-pip-version-check --no-cache-dir install jupyter \
35+ && pip --disable-pip-version-check --no-cache-dir install matplotlib \
36+ && pip --disable-pip-version-check --no-cache-dir install pillow \
37+ && pip --disable-pip-version-check --no-cache-dir install requests \
38+ && pip --disable-pip-version-check --no-cache-dir install numpy \
39+ && pip --disable-pip-version-check --no-cache-dir install pandas \
40+ && pip --disable-pip-version-check --no-cache-dir install scikit-learn \
41+ && pip --disable-pip-version-check --no-cache-dir install scikit-image \
42+ && pip --disable-pip-version-check --no-cache-dir install scipy \
43+ && pip --disable-pip-version-check --no-cache-dir install torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html \
44+ && pip --disable-pip-version-check --no-cache-dir install tensorflow \
45+ #
46+ # Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
47+ && groupadd --gid $USER_GID $USERNAME \
48+ && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
49+ # [Optional] Add sudo support for the non-root user
50+ && apt-get install -y sudo \
51+ && echo $USERNAME ALL=\( root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
52+ && chmod 0440 /etc/sudoers.d/$USERNAME \
53+ #
54+ # Clean up
55+ && apt-get autoremove -y \
56+ && apt-get clean -y \
57+ && rm -rf /var/lib/apt/lists/*
58+
59+ # Switch back to dialog for any ad-hoc use of apt-get
60+ ENV DEBIAN_FRONTEND=dialog
0 commit comments