Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(superchain): $NVM_USE_VERSION selects Node.js version #2726

Merged
merged 1 commit into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions superchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ RUN amazon-linux-extras install docker
VOLUME /var/lib/docker

# Install Node using NVM (Node Version Manager) so we can have multiple Node versions installed and easily switch
# between them.
# between them. $NVM_USE_VERSION becomes a global variable the container responds to to pick a Node version on startup,
# if set.
ENV NVM_DIR /usr/local/nvm

RUN mkdir -p $NVM_DIR && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash - \
&& echo 'source "$NVM_DIR/nvm.sh"' >> $HOME/.bash_profile
RUN mkdir -p $NVM_DIR && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash - \
&& echo 'source "$NVM_DIR/nvm.sh"' >> $HOME/.bash_profile \
&& echo '[[ -z "$NVM_USE_VERSION" ]] || nvm use "$NVM_USE_VERSION"' >> $HOME/.bash_profile

# Because we wrote things to .bash_profile, make the default shell a login shell so it gets sourced.
# Also set BASH_ENV to make bash source this EVEN if it's not a login shell (later on when the container
Expand Down
9 changes: 9 additions & 0 deletions superchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@ SDK | Version
`.NET SDK` | `>= 3.1.101`
`mono` | `>= 6.8.0.105`
`Javascript` | `node >= 10.19.0` with `npm >= 6.13.4`
| `node >= 14.24.0` with `npm >= 6.13.4`
| (both managed via NVM)
`PowerShell` | `pwsh >= 6.2.3`
`Python 3` | `python3 >= 3.7.4` with `pip3 >= 20.0.2`
`Go` | `go >= 1.16`

### Notes on Node.js

You *must* use `bash` (not `sh`) to run commands in this container.

By default, Node.js will be at version 10. To switch to Node 14,
pass `-e NVM_USE_VERSION=14` into the container at startup.

## Included Tools & Utilities

Tool / Utility | Version
Expand Down