From 03f6126dcfc3862860f15448d694a14a8c6de0bc Mon Sep 17 00:00:00 2001 From: Ng Heng Khai Date: Mon, 13 May 2024 03:31:23 +0800 Subject: [PATCH] Update Dockerfile The Source command does not have an effect on the current shell, but only on subshells. Therefore, the nvm command is not available in the current shell after the Source command. Set the NVM_DIR environment variable, then load nvm into the current shell. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 864279f..67647ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,7 @@ RUN ./mvnw clean verify -DskipTests FROM eclipse-temurin:21-jdk-jammy # Install Node.JS and NPM via NVM. -RUN /bin/bash -c "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && source ~/.bashrc && nvm install v20.13.1 && nvm use v20.13.1" +RUN /bin/bash -c "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && export NVM_DIR=\"$HOME/.nvm\" && [ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\" && nvm install v20.13.1 && nvm use v20.13.1" # Install PostgreSQL and change PostgreSQL authentication to trust. # Install the PostgreSQL package. Remove the package lists to reduce the image size.