Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 0f86dc8

Browse files
authored
Merge pull request #26 from Microsoft/clantz/azure-ml-tweaks
Update Azure ML Dockerfile based on reccomendations
2 parents da21e01 + 186a5b9 commit 0f86dc8

File tree

3 files changed

+49
-13
lines changed

3 files changed

+49
-13
lines changed

containers/azure-machine-learning-python-3/.devcontainer/Dockerfile

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,42 @@
33
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
44
#-------------------------------------------------------------------------------------------------------------
55

6-
FROM python:3
6+
# Update this to FROM python:3 if you'd prefer
7+
# to use standard python instead
8+
FROM continuumio/anaconda3
79

8-
# Install git, process tools
9-
RUN apt-get update && apt-get -y install git procps
10+
# Configure apt
11+
ENV DEBIAN_FRONTEND=noninteractive
12+
RUN apt-get update \
13+
&& apt-get -y install --no-install-recommends apt-utils 2>&1
1014

11-
# Install Docker CE - ** COMMENT OUT IF YOU WILL ONLY RUN LOCAL OR IN AZURE **
12-
RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common \
13-
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - 2>/dev/null \
14-
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
15+
# Copy default endpoint specific user settings overrides into container to
16+
# to specify Python path and that Docker should run as a workspace extension
17+
COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json
18+
19+
# Install git, required tools
20+
RUN apt-get install -y \
21+
git \
22+
curl \
23+
procps \
24+
apt-transport-https \
25+
ca-certificates \
26+
gnupg-agent \
27+
software-properties-common \
28+
sudo \
29+
lsb-release 2>&1
30+
31+
# Install Docker CLI
32+
RUN curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT) \
33+
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \
1534
&& apt-get update \
1635
&& apt-get install -y docker-ce-cli
1736

18-
# Install pylint
19-
RUN pip install pylint
37+
# Install pylint and Azure ML SDK
38+
RUN pip install pylint azureml-sdk[notebooks,automl] 2>&1
2039

2140
# Clean up
2241
RUN apt-get autoremove -y \
2342
&& apt-get clean -y \
2443
&& rm -rf /var/lib/apt/lists/*
44+
ENV DEBIAN_FRONTEND=dialog
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"remote.extensionKind": {
3+
"peterjausovec.vscode-docker": "workspace"
4+
},
5+
"python.pythonPath": "/opt/conda/bin/python",
6+
"python.linting.pylintEnabled": true,
7+
"python.linting.enabled": true
8+
}

containers/azure-machine-learning-python-3/README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
# Azure Machine Learning & Python 3
1+
# Azure Machine Learning & Python 3 - Anaconda
22

33
## Summary
44

5-
*Use Azure Machine Learning with Python 3. Includes Python, the Docker CLI (for local testing), and related extensions and dependencies.*
5+
*Use Azure Machine Learning with Python 3 - Anaconda. Includes Anaconda, the Docker CLI (for local testing), and related extensions and dependencies.*
66

77
| Metadata | Value |
88
|----------|-------|
99
| *Contributors* | The VS Code Team |
1010
| *Definition type* | Dockerfile |
11-
| *Languages, platforms* | Azure Machine Learning, Python |
11+
| *Languages, platforms* | Azure Machine Learning, Python, Anaconda |
1212

1313
## Using this definition with an existing folder
1414

15-
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:
15+
There are a few notes for using this definition:
16+
17+
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).
18+
19+
2. The definition also uses an Anaconda base image which can take some time to download the first time given its size.
20+
21+
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.
22+
23+
Once you have an Azure account, follow these steps:
1624

1725
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.
1826

0 commit comments

Comments
 (0)