Skip to content

Commit dea93be

Browse files
committed
feat: add rust
1 parent 59e0659 commit dea93be

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

sonar-node/NW.Containerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM sonarsource/sonar-scanner-cli:5
2+
3+
RUN apk add --no-cache \
4+
ca-certificates \
5+
gcc \
6+
musl-dev \
7+
openssl \
8+
openssl-dev \
9+
git \
10+
libgit2
11+
12+
## Install nvm
13+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh | bash
14+
RUN echo 'export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"' >> ${HOME}/.bashrc
15+
RUN echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ${HOME}/.bashrc && \
16+
echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> ${HOME}/.bashrc
17+
RUN . ${HOME}/.bashrc && nvm install ${NODE_VERSION} && nvm alias default ${NODE_VERSION} && nvm use default && nvm cache clear && npm install --global yarn && corepack enable pnpm
18+
ENV VSCODE_NODEJS_RUNTIME_DIR=/home/tooling/.nvm/versions/node/v${NODE_VERSION}/bin
19+
ENV PATH=/home/tooling/.nvm/versions/node/v${NODE_VERSION}/bin:$PATH

sonar-rust/Containerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM sonarsource/sonar-scanner-cli:5
2+
3+
RUN apk add --no-cache \
4+
ca-certificates \
5+
gcc \
6+
musl-dev \
7+
openssl \
8+
openssl-dev \
9+
git \
10+
libgit2
11+
12+
ENV RUSTUP_HOME=/usr/local/rustup \
13+
CARGO_HOME=/usr/local/cargo \
14+
PATH=/usr/local/cargo/bin:$PATH \
15+
RUST_VERSION=1.84.0 \
16+
OPENSSL_STATIC=true
17+
18+
RUN set -eux; \
19+
apkArch="$(apk --print-arch)"; \
20+
case "$apkArch" in \
21+
x86_64) rustArch='x86_64-unknown-linux-musl'; rustupSha256='7aa9e2a380a9958fc1fc426a3323209b2c86181c6816640979580f62ff7d48d4' ;; \
22+
aarch64) rustArch='aarch64-unknown-linux-musl'; rustupSha256='b1962dfc18e1fd47d01341e6897cace67cddfabf547ef394e8883939bd6e002e' ;; \
23+
*) echo >&2 "unsupported architecture: $apkArch"; exit 1 ;; \
24+
esac; \
25+
url="https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init"; \
26+
wget "$url"; \
27+
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
28+
chmod +x rustup-init; \
29+
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \
30+
rm rustup-init; \
31+
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
32+
rustup --version; \
33+
cargo --version; \
34+
rustc --version; \
35+
rustup component add clippy; \
36+
cargo install cargo-audit; \
37+
cargo install --locked cargo-outdated; \
38+
cargo install cargo-sonar;

0 commit comments

Comments
 (0)