[Dev Deps] update markdown-link-check

This commit is contained in:
Jordan Harband 2025-03-11 12:43:42 -07:00
parent f0f8ed12f8
commit 5c12680a62
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
2 changed files with 58 additions and 1 deletions

View File

@ -19,6 +19,7 @@
- [Install & Update Script](#install--update-script)
- [Additional Notes](#additional-notes)
- [Installing in Docker](#installing-in-docker)
- [Installing in Docker for CICD-Jobs](#installing-in-docker-for-cicd-jobs)
- [Troubleshooting on Linux](#troubleshooting-on-linux)
- [Troubleshooting on macOS](#troubleshooting-on-macos)
- [Ansible](#ansible)
@ -154,6 +155,62 @@ RUN echo node > .nvmrc
RUN nvm install
```
##### Installing in Docker for CICD-Jobs
More robust, works in CI/CD-Jobs. Can be run in interactive and non-interactive containers.
See https://github.com/nvm-sh/nvm/issues/3531.
```Dockerfile
FROM ubuntu:latest
ARG NODE_VERSION=20
# install curl
RUN apt update && apt install curl -y
# install nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
# set env
ENV NVM_DIR=/root/.nvm
# install node
RUN bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION"
# set ENTRYPOINT for reloading nvm-environment
ENTRYPOINT ["bash", "-c", "source $NVM_DIR/nvm.sh && exec \"$@\"", "--"]
# set cmd to bash
CMD ["/bin/bash"]
```
This example defaults to installation of nodejs version 20.x.y. Optionally you can easily override the version with docker build args like:
```
docker build -t nvmimage --build-arg NODE_VERSION=19 .
```
After creation of the image you can start container interactively and run commands, for example:
```
docker run --rm -it nvmimage
root@0a6b5a237c14:/# nvm -v
0.40.1
root@0a6b5a237c14:/# node -v
v19.9.0
root@0a6b5a237c14:/# npm -v
9.6.3
```
Noninteractive example:
```
user@host:/tmp/test $ docker run --rm -it nvmimage node -v
v19.9.0
user@host:/tmp/test $ docker run --rm -it nvmimage npm -v
9.6.3
```
#### Troubleshooting on Linux
On Linux, after running the install script, if you get `nvm: command not found` or see no feedback from your terminal after you type `command -v nvm`, simply close your current terminal, open a new terminal, and try verifying again.

View File

@ -45,7 +45,7 @@
"dockerfile_lint": "^0.3.4",
"doctoc": "^2.2.1",
"eclint": "^2.8.1",
"markdown-link-check": "^3.13.6",
"markdown-link-check": "^3.13.7",
"replace": "^1.2.2",
"semver": "^7.7.1",
"urchin": "^0.0.5"