diff --git a/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile b/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile index dbcc825d54..5effa0beb1 100644 --- a/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile +++ b/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile @@ -3,22 +3,42 @@ # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. #------------------------------------------------------------------------------------------------------------- -FROM python:3 +# Update this to FROM python:3 if you'd prefer +# to use standard python instead +FROM continuumio/anaconda3 -# Install git, process tools -RUN apt-get update && apt-get -y install git procps +# Configure apt +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 -# Install Docker CE - ** COMMENT OUT IF YOU WILL ONLY RUN LOCAL OR IN AZURE ** -RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common \ - && curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - 2>/dev/null \ - && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \ +# Copy default endpoint specific user settings overrides into container to +# to specify Python path and that Docker should run as a workspace extension +COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json + +# Install git, required tools +RUN apt-get install -y \ + git \ + curl \ + procps \ + apt-transport-https \ + ca-certificates \ + gnupg-agent \ + software-properties-common \ + sudo \ + lsb-release 2>&1 + +# Install Docker CLI +RUN curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ + && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ && apt-get update \ && apt-get install -y docker-ce-cli -# Install pylint -RUN pip install pylint +# Install pylint and Azure ML SDK +RUN pip install pylint azureml-sdk[notebooks,automl] 2>&1 # Clean up RUN apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/azure-machine-learning-python-3/.devcontainer/settings.vscode.json b/containers/azure-machine-learning-python-3/.devcontainer/settings.vscode.json new file mode 100644 index 0000000000..adaeba5945 --- /dev/null +++ b/containers/azure-machine-learning-python-3/.devcontainer/settings.vscode.json @@ -0,0 +1,8 @@ +{ + "remote.extensionKind": { + "peterjausovec.vscode-docker": "workspace" + }, + "python.pythonPath": "/opt/conda/bin/python", + "python.linting.pylintEnabled": true, + "python.linting.enabled": true +} \ No newline at end of file diff --git a/containers/azure-machine-learning-python-3/README.md b/containers/azure-machine-learning-python-3/README.md index af7ed7ee52..1688b7816a 100644 --- a/containers/azure-machine-learning-python-3/README.md +++ b/containers/azure-machine-learning-python-3/README.md @@ -1,18 +1,26 @@ -# Azure Machine Learning & Python 3 +# Azure Machine Learning & Python 3 - Anaconda ## Summary -*Use Azure Machine Learning with Python 3. Includes Python, the Docker CLI (for local testing), and related extensions and dependencies.* +*Use Azure Machine Learning with Python 3 - Anaconda. Includes Anaconda, the Docker CLI (for local testing), and related extensions and dependencies.* | Metadata | Value | |----------|-------| | *Contributors* | The VS Code Team | | *Definition type* | Dockerfile | -| *Languages, platforms* | Azure Machine Learning, Python | +| *Languages, platforms* | Azure Machine Learning, Python, Anaconda | ## Using this definition with an existing folder -This definition requires an Azure subscription to use. You can create a [free account here](https://account.azure.com/signup?offer=ms-azr-0044p&appId=102&ref=azureplat-generic&redirectURL=https%3a%2f%2fazure.microsoft.com%2fen-us%2fget-started%2fwelcome-to-azure%2f&l=en-us&correlationId=15FE63BE1C4960F42D1B6EFB18496296) and learn more about using [Azure Machine Learning with VS Code here](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-vscode-tools#get-started-with-azure-machine-learning). Once you have an Azure account, follow these steps: +There are a few notes for using this definition: + +1. This definition requires an Azure subscription to use. You can create a [free account here](https://account.azure.com/signup?offer=ms-azr-0044p&appId=102&ref=azureplat-generic&redirectURL=https%3a%2f%2fazure.microsoft.com%2fen-us%2fget-started%2fwelcome-to-azure%2f&l=en-us&correlationId=15FE63BE1C4960F42D1B6EFB18496296) and learn more about using [Azure Machine Learning with VS Code here](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-vscode-tools#get-started-with-azure-machine-learning). + +2. The definition also uses an Anaconda base image which can take some time to download the first time given its size. + +3. If you are using Docker locally in your `runconfig`, you will need to set `sharedVolumes` to `false` since these will not work from inside a dev container. + +Once you have an Azure account, follow these steps: 1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.