Skip to content

Commit

Permalink
fix: user creation (#3)
Browse files Browse the repository at this point in the history
* 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
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
19 changes: 18 additions & 1 deletion src/lino/.devcontainer/Dockerfile
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" ]

2 changes: 1 addition & 1 deletion src/lino/devcontainer-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "string",
"description": "version of the lino's toolbox image",
"proposals": [
"v1.3.0 # (lino:V2.4.0, pimo:v1.19.0)"
"v1.3.0"
],
"default": "v1.3.0"
}
Expand Down
10 changes: 6 additions & 4 deletions test/lino/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ cd $(dirname "$0")
source test-utils.sh

# Template specific tests
check "distro" lsb_release -c
check "lino" [ $(lino --version) ]
check "pimo" [ $(pimo --version) ]
check "sigo" [ $(sigo --version) ]
check "jq" jq --version
check "lino" lino --version
check "pimo" pimo --version
check "sigo" sigo --version
check "mimo" mimo --version
check "dsq" dsq --version

# Report result
reportResults

0 comments on commit d40cd4d

Please sign in to comment.