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

Commit a31634f

Browse files
authored
[Static Web Apps] Fix Node.js and Core Tools version mismatch (#1305)
1 parent 0186fda commit a31634f

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

containers/azure-static-web-apps/.devcontainer/Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
# Find the Dockerfile for mcr.microsoft.com/azure-functions/python:3.0-python3.8-core-tools at this URL
2-
# https://github.com/Azure/azure-functions-docker/blob/dev/host/3.0/buster/amd64/python/python38/python38-core-tools.Dockerfile
3-
FROM mcr.microsoft.com/azure-functions/python:3.0-python3.8-core-tools
1+
# Find the Dockerfile at this URL
2+
# https://github.com/Azure/azure-functions-docker/blob/dev/host/4/bullseye/amd64/python/python39/python39-core-tools.Dockerfile
3+
FROM mcr.microsoft.com/azure-functions/python:4-python3.9-core-tools
44

55
# Copy library scripts to execute
66
COPY library-scripts/*.sh library-scripts/*.env /tmp/library-scripts/
77

8-
# Install Node.js and Azure Static Web Apps CLI
9-
ARG NODE_VERSION="lts/*"
8+
# Install Node.js, Azure Static Web Apps CLI and Azure Functions Core Tools
9+
ARG NODE_VERSION="16"
10+
ARG CORE_TOOLS_VERSION="4"
1011
ENV NVM_DIR="/usr/local/share/nvm" \
1112
NVM_SYMLINK_CURRENT=true \
1213
PATH="${NVM_DIR}/current/bin:${PATH}"
1314
RUN bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \
1415
&& su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1" \
1516
&& su vscode -c "umask 0002 && npm install --cache /tmp/empty-cache -g @azure/static-web-apps-cli" \
17+
&& if [ $CORE_TOOLS_VERSION != "4" ]; then apt-get remove -y azure-functions-core-tools-4 && apt-get update && apt-get install -y "azure-functions-core-tools-${CORE_TOOLS_VERSION}"; fi \
1618
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
1719

1820
# [Optional] Uncomment this section to install additional OS packages.

containers/azure-static-web-apps/.devcontainer/devcontainer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
"build": {
44
"dockerfile": "Dockerfile",
55
"args": {
6-
// Options
7-
"NODE_VERSION": "lts/*"
6+
// Please look at runtime version support to make sure you're using compatible versions
7+
// https://docs.microsoft.com/en-us/azure/azure-functions/supported-languages#languages-by-runtime-version
8+
"NODE_VERSION": "16",
9+
"CORE_TOOLS_VERSION": "4"
810
}
911
},
1012
"forwardPorts": [ 7071, 4280 ],

0 commit comments

Comments
 (0)