Skip to content

Commit 0e4862f

Browse files
committed
Update Dockerfile to consistently declare ARGs and simplify Node.js setup
1 parent 51d0cb8 commit 0e4862f

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

Dockerfile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ARG VARIANT="1.17.3-erlang-27.1-debian-bullseye-20240926"
22
FROM hexpm/elixir:${VARIANT}
33

4+
# ARGs declared before FROM are not persisted beyond the FROM instruction.
5+
# They must be redeclared here to be available in the rest of the Dockerfile.
46
ARG PHOENIX_VERSION="1.7.10"
57
ARG NODE_VERSION="18"
68

@@ -14,11 +16,9 @@ ARG USER_GID=$USER_UID
1416
ARG INSTALL_ZSH="true"
1517
ARG UPGRADE_PACKAGES="true"
1618
ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/common-debian.sh"
17-
ARG COMMON_SCRIPT_SHA="dev-mode"
1819

19-
# [Optional] Setup nodejs
20+
# Options for setup nodejs
2021
ARG NODE_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/node-debian.sh"
21-
ARG NODE_SCRIPT_SHA="dev-mode"
2222
ENV NVM_DIR=/usr/local/share/nvm
2323
ENV NVM_SYMLINK_CURRENT=true
2424
ENV PATH=${NVM_DIR}/current/bin:${PATH}
@@ -28,16 +28,12 @@ RUN apt-get update \
2828
&& export DEBIAN_FRONTEND=noninteractive \
2929
&& apt-get -y install --no-install-recommends curl ca-certificates 2>&1 \
3030
&& curl -sSL ${COMMON_SCRIPT_SOURCE} -o /tmp/common-setup.sh \
31-
&& ([ "${COMMON_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} */tmp/common-setup.sh" | sha256sum -c -)) \
3231
&& /bin/bash /tmp/common-setup.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
3332
#
34-
# [Optional] Install Node.js for use with web applications
35-
&& if [ "${NODE_VERSION}" != "none" ]; then \
36-
curl -sSL ${NODE_SCRIPT_SOURCE} -o /tmp/node-setup.sh \
37-
&& ([ "${NODE_SCRIPT_SHA}" = "dev-mode" ] || (echo "${NODE_SCRIPT_SHA} */tmp/node-setup.sh" | sha256sum -c -)) \
33+
# Install Node.js for use with web applications
34+
&& curl -sSL ${NODE_SCRIPT_SOURCE} -o /tmp/node-setup.sh \
3835
&& /bin/bash /tmp/node-setup.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \
39-
&& npm install -g cspell@latest; \
40-
fi \
36+
&& npm install -g cspell@latest \
4137
#
4238
# Install dependencies
4339
&& apt-get install -y build-essential inotify-tools \

0 commit comments

Comments
 (0)