generated from devcontainers/template-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: user creation * fix: add sudo and configure sudoers * fix: devconainer test
- Loading branch information
Youen Péron
authored
Sep 25, 2023
1 parent
a2d3a80
commit d40cd4d
Showing
3 changed files
with
25 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
FROM cgifr/lino-toolbox:${templateOption:imageVariant} | ||
FROM cgifr/lino-toolbox:${templateOption:imageVariant}-debian | ||
ARG USERNAME=lino | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
|
||
USER "root" | ||
|
||
# Create the user lino | ||
RUN groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ | ||
# add sudo for user | ||
&& apt-get update \ | ||
&& apt-get install -y sudo \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME | ||
|
||
USER $USERNAME | ||
|
||
CMD [ "sleep", "infinity" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters