mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-10-11 00:00:13 +08:00
[readme] Fix a Docker warning from using Docker installation instructions
Fix a LegacyKeyValueFormat warning when building a Docker image using the 'Installing In Docker' instructions. The warning fixed is: `LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format` See: [LegacyKeyValueFormat](https://docs.docker.com/reference/build-checks/legacy-key-value-format/) Co-authored-by: clifennel <li.chr+github@northeastern.edu> Co-authored-by: Jordan Harband <ljharb@gmail.com>
This commit is contained in:
co-authored by
Jordan Harband
parent
5c05fb659c
commit
6dc3765f6b
+3
-3
@@ -15,14 +15,14 @@ LABEL version="latest"
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# Prevent dialog during apt install
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# ShellCheck version
|
||||
ENV SHELLCHECK_VERSION=0.7.0
|
||||
|
||||
# Pick a Ubuntu apt mirror site for better speed
|
||||
# ref: https://launchpad.net/ubuntu/+archivemirrors
|
||||
ENV UBUNTU_APT_SITE ubuntu.cs.utah.edu
|
||||
ENV UBUNTU_APT_SITE=ubuntu.cs.utah.edu
|
||||
|
||||
# Replace origin apt package site with the mirror site
|
||||
RUN sed -E -i "s/([a-z]+.)?archive.ubuntu.com/$UBUNTU_APT_SITE/g" /etc/apt/sources.list
|
||||
@@ -92,7 +92,7 @@ RUN echo 'nvm ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
USER nvm
|
||||
|
||||
# Create a script file sourced by both interactive and non-interactive bash shells
|
||||
ENV BASH_ENV /home/nvm/.bash_env
|
||||
ENV BASH_ENV=/home/nvm/.bash_env
|
||||
RUN touch "$BASH_ENV"
|
||||
RUN echo '. "$BASH_ENV"' >> "$HOME/.bashrc"
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ When invoking bash as a non-interactive shell, like in a [Docker](https://www.do
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# Create a script file sourced by both interactive and non-interactive bash shells
|
||||
ENV BASH_ENV "${HOME}/.bash_env"
|
||||
ENV BASH_ENV="${HOME:-/root}/.bash_env"
|
||||
RUN touch "${BASH_ENV}"
|
||||
RUN echo '. "${BASH_ENV}"' >> ~/.bashrc
|
||||
|
||||
@@ -174,7 +174,7 @@ RUN apt update && apt install curl -y
|
||||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash
|
||||
|
||||
# set env
|
||||
ENV NVM_DIR=/root/.nvm
|
||||
ENV NVM_DIR="${HOME:-/root}/.nvm"
|
||||
|
||||
# install node
|
||||
RUN bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION"
|
||||
|
||||
Reference in New Issue
Block a user