Skip to content

Commit 57028be

Browse files
authored
Updating devcontainer for aarch64 (#20)
* Updating devcontainer for aarch64 * Updating devcontainer Dockerfile for aarch64 architecture * Updating devcontainer.json for appropriate python tools
1 parent 0b2d34a commit 57028be

File tree

3 files changed

+61
-52
lines changed

3 files changed

+61
-52
lines changed

.devcontainer/Dockerfile

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
1-
FROM mcr.microsoft.com/vscode/devcontainers/universal:latest
1+
FROM mcr.microsoft.com/vscode/devcontainers/python:dev-3.12-bookworm
22

33
# Copy custom first notice message.
44
COPY first-run-notice.txt /tmp/staging/
55
RUN sudo mv -f /tmp/staging/first-run-notice.txt /usr/local/etc/vscode-dev-containers/ \
66
&& sudo rm -rf /tmp/staging
77

8-
# Install PowerShell 7.x
9-
RUN sudo apt-get update \
10-
&& sudo apt-get install -y wget apt-transport-https software-properties-common \
11-
&& wget -q https://packages.microsoft.com/config/ubuntu/$(. /etc/os-release && echo $VERSION_ID)/packages-microsoft-prod.deb \
12-
&& sudo dpkg -i packages-microsoft-prod.deb \
13-
&& sudo apt-get update \
14-
&& sudo apt-get install -y powershell
8+
# Install Node.js and npm
9+
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - \
10+
&& sudo apt-get install -y nodejs
1511

1612
# Install Azure Functions Core Tools
17-
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg \
18-
&& sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg \
19-
&& sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list' \
20-
&& sudo apt-get update \
21-
&& sudo apt-get install -y azure-functions-core-tools-4
13+
# Preview with aarch64 support
14+
RUN sudo npm install -g azure-functions-core-tools
15+
16+
# Install MCP Inspector
17+
RUN sudo npm install -g @modelcontextprotocol/inspector
18+
19+
# Install azurite to emulate Azure Storage
20+
RUN sudo npm install -g azurite
2221

2322
# Install Azure Developer CLI
2423
RUN curl -fsSL https://aka.ms/install-azd.sh | bash
25-
26-
# Install mechanical-markdown for quickstart validations
27-
RUN pip install mechanical-markdown

.devcontainer/devcontainer.json

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
13
{
2-
"name": "Functions Quickstarts Codespace",
3-
"dockerFile": "Dockerfile",
4-
"features": {
5-
"azure-cli": "latest"
6-
},
7-
"customizations": {
8-
"vscode": {
9-
"extensions": [
10-
"ms-azuretools.vscode-bicep",
11-
"ms-azuretools.vscode-docker",
12-
"ms-azuretools.vscode-azurefunctions",
13-
"GitHub.copilot",
14-
"humao.rest-client"
15-
]
16-
}
17-
},
18-
"mounts": [
19-
// Mount docker-in-docker library volume
20-
"source=codespaces-linux-var-lib-docker,target=/var/lib/docker,type=volume"
21-
],
22-
// Always run image-defined docker-init.sh to enable docker-in-docker
23-
"overrideCommand": false,
24-
"remoteUser": "codespace",
25-
"runArgs": [
26-
// Enable ptrace-based debugging for Go in container
27-
"--cap-add=SYS_PTRACE",
28-
"--security-opt",
29-
"seccomp=unconfined",
30-
31-
// Enable docker-in-docker configuration
32-
"--init",
33-
"--privileged"
34-
]
35-
}
36-
4+
"name": "Functions Quickstarts Codespace - Python, aarch64 ready",
5+
"dockerFile": "Dockerfile",
6+
"features": {
7+
"azure-cli": "latest"
8+
},
9+
"forwardPorts": [7071],
10+
"portsAttributes": {
11+
"7071": {
12+
"label": "Azure Functions",
13+
"onAutoForward": "notify"
14+
}
15+
},
16+
"postCreateCommand": "bash -c 'echo \"export PROMPT_DIRTRIM=1\" >> ~/.bashrc || true; mkdir -p ~/.azurite || true; cat .devcontainer/first-run-notice.txt || echo \"Setup completed\"'; npx azurite --location ~/.azurite --silent || true",
17+
"customizations": {
18+
"vscode": {
19+
"extensions": [
20+
"ms-python.python",
21+
"ms-python.debugpy",
22+
"ms-python.vscode-python-envs",
23+
"ms-azuretools.vscode-bicep",
24+
"ms-azuretools.vscode-docker",
25+
"ms-azuretools.vscode-azurefunctions",
26+
"GitHub.copilot",
27+
"humao.rest-client"
28+
],
29+
"settings": {
30+
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true,
31+
"dotnet.symbolSearch.searchReferenceAssemblies": true,
32+
"azureFunctions.showProjectWarning": false
33+
}
34+
}
35+
},
36+
"remoteUser": "vscode",
37+
"shutdownAction": "stopContainer"
38+
}

.devcontainer/first-run-notice.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
👋 Welcome to the Functions Codespace! You are on the Functions Quickstarts image.
22
It includes everything needed to run through our tutorials and quickstart applications.
33

4-
📚 Functions docs can be found at: https://learn.microsoft.com/en-us/azure/azure-functions/
4+
To run a function enter folder with host.json and run:
5+
```
6+
cd src
7+
func start
8+
```
59

10+
📚 Setup complete. Functions docs can be found at: https://learn.microsoft.com/en-us/azure/azure-functions/
611
>**Note** it is a best practice to create Virtual Environments before doing the `pip install` to avoid dependency issues/collisions, or if you are running in CodeSpaces. See [Python Environments in VS Code](https://code.visualstudio.com/docs/python/environments#_creating-environments) for more information.
12+
13+
14+
Automatically started Azurite in a new terminal window first via:
15+
```
16+
npx azurite --location ~/.azurite
17+
```

0 commit comments

Comments
 (0)