-
Notifications
You must be signed in to change notification settings - Fork 48
Updating devcontainer for aarch64 #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,23 @@ | ||
FROM mcr.microsoft.com/vscode/devcontainers/universal:latest | ||
FROM mcr.microsoft.com/vscode/devcontainers/python:dev-3.12-bookworm | ||
|
||
# Copy custom first notice message. | ||
COPY first-run-notice.txt /tmp/staging/ | ||
RUN sudo mv -f /tmp/staging/first-run-notice.txt /usr/local/etc/vscode-dev-containers/ \ | ||
&& sudo rm -rf /tmp/staging | ||
|
||
# Install PowerShell 7.x | ||
RUN sudo apt-get update \ | ||
&& sudo apt-get install -y wget apt-transport-https software-properties-common \ | ||
&& wget -q https://packages.microsoft.com/config/ubuntu/$(. /etc/os-release && echo $VERSION_ID)/packages-microsoft-prod.deb \ | ||
&& sudo dpkg -i packages-microsoft-prod.deb \ | ||
&& sudo apt-get update \ | ||
&& sudo apt-get install -y powershell | ||
# Install Node.js and npm | ||
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - \ | ||
&& sudo apt-get install -y nodejs | ||
|
||
# Install Azure Functions Core Tools | ||
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg \ | ||
&& sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg \ | ||
&& 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' \ | ||
&& sudo apt-get update \ | ||
&& sudo apt-get install -y azure-functions-core-tools-4 | ||
# Preview with aarch64 support | ||
RUN sudo npm install -g azure-functions-core-tools | ||
|
||
# Install MCP Inspector | ||
RUN sudo npm install -g @modelcontextprotocol/inspector | ||
|
||
# Install azurite to emulate Azure Storage | ||
RUN sudo npm install -g azurite | ||
|
||
# Install Azure Developer CLI | ||
RUN curl -fsSL https://aka.ms/install-azd.sh | bash | ||
|
||
# Install mechanical-markdown for quickstart validations | ||
RUN pip install mechanical-markdown |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,37 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/python | ||
{ | ||
"name": "Functions Quickstarts Codespace", | ||
"dockerFile": "Dockerfile", | ||
"features": { | ||
"azure-cli": "latest" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-azuretools.vscode-bicep", | ||
"ms-azuretools.vscode-docker", | ||
"ms-azuretools.vscode-azurefunctions", | ||
"GitHub.copilot", | ||
"humao.rest-client" | ||
] | ||
} | ||
}, | ||
"mounts": [ | ||
// Mount docker-in-docker library volume | ||
"source=codespaces-linux-var-lib-docker,target=/var/lib/docker,type=volume" | ||
], | ||
// Always run image-defined docker-init.sh to enable docker-in-docker | ||
"overrideCommand": false, | ||
"remoteUser": "codespace", | ||
"runArgs": [ | ||
// Enable ptrace-based debugging for Go in container | ||
"--cap-add=SYS_PTRACE", | ||
"--security-opt", | ||
"seccomp=unconfined", | ||
|
||
// Enable docker-in-docker configuration | ||
"--init", | ||
"--privileged" | ||
] | ||
} | ||
|
||
"name": "Functions Quickstarts Codespace - Python, aarch64 ready", | ||
"dockerFile": "Dockerfile", | ||
"features": { | ||
"azure-cli": "latest" | ||
}, | ||
"forwardPorts": [7071], | ||
"portsAttributes": { | ||
"7071": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. optional: should we mention why this port is being used in the first-run-notice.txt section? |
||
"label": "Azure Functions", | ||
"onAutoForward": "notify" | ||
} | ||
}, | ||
"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", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that this is a Python project, are we still intending to install .NET extensions? In other words, should |
||
"ms-dotnettools.csdevkit", | ||
"ms-dotnettools.dotnet-interactive-vscode", | ||
"ms-azuretools.vscode-bicep", | ||
"ms-azuretools.vscode-docker", | ||
"ms-azuretools.vscode-azurefunctions", | ||
"GitHub.copilot", | ||
"humao.rest-client" | ||
], | ||
"settings": { | ||
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true, | ||
"dotnet.symbolSearch.searchReferenceAssemblies": true, | ||
"azureFunctions.showProjectWarning": false | ||
} | ||
} | ||
}, | ||
"remoteUser": "vscode", | ||
"shutdownAction": "stopContainer" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
👋 Welcome to the Functions Codespace! You are on the Functions Quickstarts image. | ||
It includes everything needed to run through our tutorials and quickstart applications. | ||
|
||
📚 Functions docs can be found at: https://learn.microsoft.com/en-us/azure/azure-functions/ | ||
To run a function enter folder with host.json and run: | ||
``` | ||
cd src | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if customers are already in the folder with
|
||
func start | ||
``` | ||
|
||
📚 Setup complete. Functions docs can be found at: https://learn.microsoft.com/en-us/azure/azure-functions/ | ||
>**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. | ||
|
||
|
||
Automatically started Azurite in a new terminal window first via: | ||
``` | ||
npx azurite --location ~/.azurite | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is specifying the specific python image a python specific thing? For non-Python languages, can we still use
.../universal:latest
?