Skip to content

Commit

Permalink
Update Dev Container: Add Azure Tools, port forwarding and force AMD64 (
Browse files Browse the repository at this point in the history
#171)

Add Azure Tools and port forwarding
Always use AMD64 image
  • Loading branch information
velsietis authored Jan 17, 2024
1 parent 6300d22 commit 19beb91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
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

0 comments on commit 19beb91

Please sign in to comment.