Skip to content

Commit 5c12680

Browse files
committed
[Dev Deps] update markdown-link-check
1 parent f0f8ed1 commit 5c12680

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- [Install & Update Script](#install--update-script)
2020
- [Additional Notes](#additional-notes)
2121
- [Installing in Docker](#installing-in-docker)
22+
- [Installing in Docker for CICD-Jobs](#installing-in-docker-for-cicd-jobs)
2223
- [Troubleshooting on Linux](#troubleshooting-on-linux)
2324
- [Troubleshooting on macOS](#troubleshooting-on-macos)
2425
- [Ansible](#ansible)
@@ -154,6 +155,62 @@ RUN echo node > .nvmrc
154155
RUN nvm install
155156
```
156157

158+
##### Installing in Docker for CICD-Jobs
159+
160+
More robust, works in CI/CD-Jobs. Can be run in interactive and non-interactive containers.
161+
See https://github.com/nvm-sh/nvm/issues/3531.
162+
163+
```Dockerfile
164+
FROM ubuntu:latest
165+
ARG NODE_VERSION=20
166+
167+
# install curl
168+
RUN apt update && apt install curl -y
169+
170+
# install nvm
171+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
172+
173+
# set env
174+
ENV NVM_DIR=/root/.nvm
175+
176+
# install node
177+
RUN bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION"
178+
179+
# set ENTRYPOINT for reloading nvm-environment
180+
ENTRYPOINT ["bash", "-c", "source $NVM_DIR/nvm.sh && exec \"$@\"", "--"]
181+
182+
# set cmd to bash
183+
CMD ["/bin/bash"]
184+
185+
```
186+
187+
This example defaults to installation of nodejs version 20.x.y. Optionally you can easily override the version with docker build args like:
188+
```
189+
docker build -t nvmimage --build-arg NODE_VERSION=19 .
190+
```
191+
192+
After creation of the image you can start container interactively and run commands, for example:
193+
```
194+
docker run --rm -it nvmimage
195+
196+
root@0a6b5a237c14:/# nvm -v
197+
0.40.1
198+
199+
root@0a6b5a237c14:/# node -v
200+
v19.9.0
201+
202+
root@0a6b5a237c14:/# npm -v
203+
9.6.3
204+
```
205+
206+
Noninteractive example:
207+
```
208+
user@host:/tmp/test $ docker run --rm -it nvmimage node -v
209+
v19.9.0
210+
user@host:/tmp/test $ docker run --rm -it nvmimage npm -v
211+
9.6.3
212+
```
213+
157214
#### Troubleshooting on Linux
158215

159216
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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"dockerfile_lint": "^0.3.4",
4646
"doctoc": "^2.2.1",
4747
"eclint": "^2.8.1",
48-
"markdown-link-check": "^3.13.6",
48+
"markdown-link-check": "^3.13.7",
4949
"replace": "^1.2.2",
5050
"semver": "^7.7.1",
5151
"urchin": "^0.0.5"

0 commit comments

Comments
 (0)