Skip to content

Commit 2cf6dff

Browse files
committed
feat(linter): assert env instruction for PATH
1 parent 2837b22 commit 2cf6dff

File tree

14 files changed

+30
-15
lines changed

14 files changed

+30
-15
lines changed

boilerplates/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- **`RUN`**: Commands for setting up the environment, including installing the **packages files**, removing cache files, and creating the non-root user.
1515
- **`WORKDIR`**: Path to the project files inside the container `/home/$USERNAME/workspace`.
1616
- **`USER`**: Specifies the user to the non-root `$USERNAME`.
17-
- **`ENV`**: Environment variables for the non-root user, primarily its local `$PATH` and package managers (`/home/$USERNAME/.local/share/<manager>`).
17+
- **`ENV`**: Environment variables for the non-root user, primarily its local `$PATH` (`/home/$USERNAME/.local/bin:$PATH"`) and package managers (`/home/$USERNAME/.local/share/<manager>`).
1818
- **`CMD`**: Default command to start the container `["/bin/bash", "-l"]`.
1919

2020
### Base image

boilerplates/ansible/fedora/Containerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ WORKDIR /home/$USERNAME/workspace
2020

2121
USER $USERNAME
2222

23+
ENV PATH="/home/$USERNAME/.local/bin:$PATH"
2324
ENV PATH="/home/$USERNAME/.local/venv/bin:$PATH" \
2425
NPM_CONFIG_PREFIX="/home/$USERNAME/.local"
2526

boilerplates/bash/community/Containerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ WORKDIR /home/$USERNAME/workspace
1717

1818
USER $USERNAME
1919

20-
ENV NPM_CONFIG_PREFIX="/home/$USERNAME/.local" \
21-
PATH="/home/$USERNAME/.local/bin:$PATH"
20+
ENV PATH="/home/$USERNAME/.local/bin:$PATH" \
21+
NPM_CONFIG_PREFIX="/home/$USERNAME/.local"
2222

2323
RUN xargs -n 1 npm install -g < /tmp/npm.txt && npm cache clean --force
2424

25-
CMD ["bash", "-l"]
25+
CMD ["bash", "-l"]

boilerplates/bash/fedora/Containerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ WORKDIR /home/$USERNAME/workspace
1717

1818
USER $USERNAME
1919

20-
ENV NPM_CONFIG_PREFIX="/home/$USERNAME/.local"
20+
ENV PATH="/home/$USERNAME/.local/bin:$PATH" \
21+
NPM_CONFIG_PREFIX="/home/$USERNAME/.local"
2122

2223
RUN xargs -n 1 npm install -g < /tmp/npm.txt && npm cache clean --force
2324

boilerplates/c/fedora/Containerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ WORKDIR /home/$USERNAME/workspace
1717

1818
USER $USERNAME
1919

20+
ENV PATH="/home/$USERNAME/.local/bin:$PATH"
21+
2022
CMD ["/bin/bash", "-l"]

boilerplates/go/community/Containerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ RUN chown $USERNAME:$USERNAME ./go.mod ./go.sum
2323

2424
USER $USERNAME
2525

26-
ENV GOPATH=/home/$USERNAME/go \
26+
ENV PATH="/home/$USERNAME/.local/bin:$PATH" \
27+
GOPATH=/home/$USERNAME/go \
2728
GOBIN="/home/$USERNAME/.local/bin"
2829

2930
RUN xargs -n 1 go install < /tmp/go.txt
3031
RUN go mod download && go mod verify
3132

32-
CMD ["/bin/bash", "-l"]
33+
CMD ["/bin/bash", "-l"]

boilerplates/go/fedora/Containerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ RUN chown $USERNAME:$USERNAME ./go.mod ./go.sum
2020

2121
USER $USERNAME
2222

23-
ENV GOPATH=/home/$USERNAME/go \
23+
ENV PATH="/home/$USERNAME/.local/bin:$PATH" \
24+
GOPATH=/home/$USERNAME/go \
2425
GOBIN="/home/$USERNAME/.local/bin"
2526

2627
RUN xargs -n 1 go install < /tmp/go.txt

boilerplates/guile/fedora/Containerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ WORKDIR /home/$USERNAME/workspace
1717

1818
USER $USERNAME
1919

20+
ENV PATH="/home/$USERNAME/.local/bin:$PATH"
21+
2022
CMD ["/bin/bash", "-l"]

boilerplates/haskell/fedora/Containerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ WORKDIR /home/$USERNAME/workspace
1717

1818
USER $USERNAME
1919

20-
ENV BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \
20+
ENV PATH="/home/$USERNAME/.local/bin:$PATH" \
21+
BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \
2122
BOOTSTRAP_HASKELL_CABAL_XDG=1 \
2223
BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 \
2324
BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK=1 \
24-
GHCUP_USE_XDG_DIRS=1 \
25-
PATH="/home/$USERNAME/.local/bin:$PATH"
25+
GHCUP_USE_XDG_DIRS=1
2626

2727
# hadolint ignore=DL4006,SC3040
2828
RUN set -o pipefail && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | bash

boilerplates/javascript/fedora/Containerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ WORKDIR /home/$USERNAME/workspace
1717

1818
USER $USERNAME
1919

20-
ENV NPM_CONFIG_PREFIX="/home/$USERNAME/.local"
20+
ENV PATH="/home/$USERNAME/.local/bin:$PATH" \
21+
NPM_CONFIG_PREFIX="/home/$USERNAME/.local"
2122

2223
RUN xargs -n 1 npm install -g < /tmp/npm.txt && npm cache clean --force
2324

0 commit comments

Comments
 (0)