Skip to content
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

Update Dev Container: Add Azure Tools, port forwarding and force AMD64 #171

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# need to ensure AMD64 is used because Azure Functions won't run properly on ARM64
FROM --platform=amd64 mcr.microsoft.com/devcontainers/base:jammy
15 changes: 11 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"build": { "dockerfile": "Dockerfile" },
// Using Dockefile reference above to specify the platform as Azure Functions won't run properly on ARM64
// See https://github.com/docker/roadmap/issues/384
// "image": "mcr.microsoft.com/devcontainers/base:jammy",

"runArgs": ["--add-host=host.docker.internal:host-gateway"],
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
Expand All @@ -16,10 +19,14 @@
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
"forwardPorts": [7071, 7072, 7073, 7074],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install"
"postCreateCommand": "npm i -g azure-functions-core-tools@4 --unsafe-perm true && npm install",

"remoteEnv": {
"FUNCTIONS_CORE_TOOLS_TELEMETRY_OPTOUT" : "1"
}

// Configure tool-specific properties.
// "customizations": {},
Expand Down