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

Commit 1883442

Browse files
committed
Use NVM for Azure Functions node install
1 parent 05a6a04 commit 1883442

File tree

4 files changed

+24
-18
lines changed

4 files changed

+24
-18
lines changed

containers/azure-functions-node-8/.devcontainer/Dockerfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55

66
FROM microsoft/dotnet:2.1-sdk-bionic
77

8-
# Install git, process tools
8+
# Install git, process tools, bash
99
RUN apt-get update && apt-get -y install git procps
1010

11-
# Install Node.js
12-
# Update "setup" to "setup_<verison>.x" if you want a specific verison of Node.js
13-
# See https://github.com/nodesource/distributions/tree/master/deb for a list
14-
RUN apt-get install -y curl \
15-
&& curl -sSL https://deb.nodesource.com/setup_8.x | bash - \
16-
&& apt-get update \
17-
&& apt-get install -y nodejs
11+
# Install Node.js via NVM - See https://github.com/creationix/nvm
12+
# Change the number "8" in the two lines below to pick a different version
13+
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash \
14+
&& /bin/bash -c "source $HOME/.nvm/nvm.sh \
15+
&& nvm install 8 \
16+
&& nvm alias default 8"
17+
18+
# Install eslint
19+
RUN /bin/bash -c "source $HOME/.nvm/nvm.sh && npm install -g eslint"
1820

1921
# Install Azure Functions
2022
RUN apt-get install -y apt-transport-https \

containers/azure-functions-node-8/.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"dockerFile": "Dockerfile",
44
"appPort": 7071,
55
"extensions": [
6-
"ms-azuretools.vscode-azurefunctions"
6+
"ms-azuretools.vscode-azurefunctions",
7+
"dbaeumer.vscode-eslint"
78
]
89
}

containers/azure-functions-node-lts/.devcontainer/Dockerfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55

66
FROM microsoft/dotnet:2.1-sdk-bionic
77

8-
# Install git, process tools
8+
# Install git, process tools, bash
99
RUN apt-get update && apt-get -y install git procps
1010

11-
# Install Node.js
12-
# Update "setup" to "setup_<verison>.x" if you want a specific verison of Node.js
13-
# See https://github.com/nodesource/distributions/tree/master/deb for a list
14-
RUN apt-get install -y curl \
15-
&& curl -sSL https://deb.nodesource.com/setup | bash - \
16-
&& apt-get update \
17-
&& apt-get install -y nodejs
11+
# Install Node.js via NVM - See https://github.com/creationix/nvm
12+
# Change the "lts/*" in the two lines below to pick a different version
13+
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash \
14+
&& /bin/bash -c "source $HOME/.nvm/nvm.sh \
15+
&& nvm install lts/* \
16+
&& nvm alias default lts/*"
17+
18+
# Install eslint
19+
RUN /bin/bash -c "source $HOME/.nvm/nvm.sh && npm install -g eslint"
1820

1921
# Install Azure Functions
2022
RUN apt-get install -y apt-transport-https \

containers/azure-functions-node-lts/.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"dockerFile": "Dockerfile",
44
"appPort": 7071,
55
"extensions": [
6-
"ms-azuretools.vscode-azurefunctions"
6+
"ms-azuretools.vscode-azurefunctions",
7+
"dbaeumer.vscode-eslint"
78
]
89
}

0 commit comments

Comments
 (0)