File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 15
15
]
16
16
}
17
17
},
18
- "postCreateCommand" : " .devcontainer/postCreate.sh"
18
+ "postCreateCommand" : " .devcontainer/postCreate.sh" ,
19
+ "remoteUser" : " devuser"
19
20
}
Original file line number Diff line number Diff line change @@ -2,12 +2,28 @@ FROM rust:1.80.1-bullseye
2
2
LABEL org.opencontainers.image.authors="Christoph Knittel <ck@cca.io>"
3
3
LABEL org.opencontainers.image.description="Docker image for ReScript development."
4
4
5
- RUN apt update && apt install -y --no-install-recommends ca-certificates curl git rsync opam musl-tools python3 python-is-python3
5
+ RUN apt update && apt install -y --no-install-recommends sudo ca-certificates curl git rsync opam musl-tools python3 python-is-python3
6
6
7
7
# Node.js
8
8
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
9
9
RUN apt install -y nodejs
10
10
11
+ # Create a non-root user and switch to it
12
+ ARG USERNAME=devuser
13
+ ARG USER_UID=1000
14
+ ARG USER_GID=$USER_UID
15
+
16
+ RUN groupadd --gid $USER_GID $USERNAME \
17
+ && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
18
+ && usermod -aG sudo $USERNAME \
19
+ && mkdir /workspaces \
20
+ && chown -R $USERNAME:$USERNAME /workspaces
21
+
22
+ # Allow the devuser to use sudo without a password
23
+ RUN echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
24
+
25
+ USER $USERNAME
26
+
11
27
# OCaml
12
28
RUN opam init -y --bare --disable-sandboxing git+https://github.com/rescript-lang/opam-repository
13
29
RUN opam switch create 5.2.0 --packages ocaml-option-static
You can’t perform that action at this time.
0 commit comments