Skip to content

Commit 6dc3765

Browse files
clifennelljharb
andcommitted
[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>
1 parent 5c05fb6 commit 6dc3765

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎Dockerfile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ LABEL version="latest"
1515
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
1616

1717
# Prevent dialog during apt install
18-
ENV DEBIAN_FRONTEND noninteractive
18+
ENV DEBIAN_FRONTEND=noninteractive
1919

2020
# ShellCheck version
2121
ENV SHELLCHECK_VERSION=0.7.0
2222

2323
# Pick a Ubuntu apt mirror site for better speed
2424
# ref: https://launchpad.net/ubuntu/+archivemirrors
25-
ENV UBUNTU_APT_SITE ubuntu.cs.utah.edu
25+
ENV UBUNTU_APT_SITE=ubuntu.cs.utah.edu
2626

2727
# Replace origin apt package site with the mirror site
2828
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
9292
USER nvm
9393

9494
# Create a script file sourced by both interactive and non-interactive bash shells
95-
ENV BASH_ENV /home/nvm/.bash_env
95+
ENV BASH_ENV=/home/nvm/.bash_env
9696
RUN touch "$BASH_ENV"
9797
RUN echo '. "$BASH_ENV"' >> "$HOME/.bashrc"
9898

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ When invoking bash as a non-interactive shell, like in a [Docker](https://www.do
148148
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
149149

150150
# Create a script file sourced by both interactive and non-interactive bash shells
151-
ENV BASH_ENV "${HOME}/.bash_env"
151+
ENV BASH_ENV="${HOME:-/root}/.bash_env"
152152
RUN touch "${BASH_ENV}"
153153
RUN echo '. "${BASH_ENV}"' >> ~/.bashrc
154154

@@ -174,7 +174,7 @@ RUN apt update && apt install curl -y
174174
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash
175175

176176
# set env
177-
ENV NVM_DIR=/root/.nvm
177+
ENV NVM_DIR="${HOME:-/root}/.nvm"
178178

179179
# install node
180180
RUN bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION"

0 commit comments

Comments
 (0)