Skip to content

Commit

Permalink
Merge pull request #12 from lamoglia/update/node-installation
Browse files Browse the repository at this point in the history
Update deprecated node installation method
  • Loading branch information
Remi-Gau authored Nov 9, 2023
2 parents 96e4a6c + 87c1fd6 commit 2e8725e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@ workflows:
requires:
- build
filters:
branches:
only: master
tags:
only: /.*/
1 change: 1 addition & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ ignored:
- DL3006
- DL3008
- DL4006
- SC2016
38 changes: 33 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
FROM ubuntu:jammy-20221130
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
ca-certificates curl apt-utils \
ca-certificates curl apt-utils gnupg \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
ENV NODE_MAJOR="18"
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
nodejs \
&& rm -rf /var/lib/apt/lists/*
RUN node --version && npm --version && npm install -g bids-validator@1.9.9
RUN node --version && npm --version && npm install -g bids-validator@1.13.1

# Save specification to JSON.
RUN printf '{ \
Expand All @@ -29,15 +33,39 @@ RUN printf '{ \
"name": "install", \
"kwds": { \
"pkgs": [ \
"ca-certificates curl apt-utils" \
"ca-certificates curl apt-utils gnupg" \
], \
"opts": null \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n ca-certificates curl apt-utils \\\\\\n && rm -rf /var/lib/apt/lists/*" \
"command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n ca-certificates curl apt-utils gnupg \\\\\\n && rm -rf /var/lib/apt/lists/*" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "mkdir -p /etc/apt/keyrings" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"NODE_MAJOR": "18" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "echo \\"deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main\\" | tee /etc/apt/sources.list.d/nodesource.list" \
} \
}, \
{ \
Expand All @@ -64,7 +92,7 @@ RUN printf '{ \
{ \
"name": "run", \
"kwds": { \
"command": "node --version && npm --version && npm install -g bids-validator@1.9.9" \
"command": "node --version && npm --version && npm install -g bids-validator@1.13.1" \
} \
} \
] \
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ Dockerfile:
generate docker \
--base-image ubuntu:jammy-20221130 \
--pkg-manager apt \
--install "ca-certificates curl apt-utils" \
--install "ca-certificates curl apt-utils gnupg" \
--run "mkdir -p /etc/apt/keyrings" \
--run "curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg" \
--env NODE_MAJOR=18 \
--run 'echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list' \
--run "curl -sL https://deb.nodesource.com/setup_18.x | bash -" \
--install "nodejs" \
--run "node --version && npm --version && npm install -g bids-validator@1.11.0" \
--run "node --version && npm --version && npm install -g bids-validator@1.13.1" \
> Dockerfile

0 comments on commit 2e8725e

Please sign in to comment.