Skip to content

Commit 34ef078

Browse files
committed
add script to create local user, add update script, add nodejs for extension development
1 parent c86b715 commit 34ef078

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

devcontainer/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
FROM ghcr.io/rsl-org/fedora_p2996:latest
22

3+
RUN echo '%wheel ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
4+
35
RUN dnf install -y zsh
46
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
57
RUN sed -i 's/robbyrussell/eastwood/g' /root/.zshrc
68
RUN chsh -s /bin/zsh
79

810
RUN git clone https://github.com/rsl-org/conan
9-
RUN conan remote add rsl ./conan
11+
RUN conan remote add rsl ./conan
12+
13+
ADD setup_user.sh /setup_user.sh
14+
RUN chmod a+x /setup_user.sh

devcontainer/setup_user.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
echo "Creating user: $LOCAL_USER with UID: $LOCAL_UID and GID: $LOCAL_GID"
5+
6+
if ! getent group "$LOCAL_GID" >/dev/null 2>&1; then
7+
groupadd -g "$LOCAL_GID" "$LOCAL_USER"
8+
fi
9+
10+
if ! id -u "$LOCAL_USER" >/dev/null 2>&1; then
11+
useradd -u "$LOCAL_UID" -g "$LOCAL_GID" -G wheel -d $LOCAL_HOME -s /bin/zsh "$LOCAL_USER"
12+
fi
13+
14+
if ! grep -q '^%wheel ALL=(ALL) NOPASSWD:ALL' /etc/sudoers; then
15+
echo '%wheel ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
16+
fi
17+
18+
chown -R $LOCAL_USER:$LOCAL_GID $LOCAL_HOME
19+
sudo -u $LOCAL_USER ZSH=$LOCAL_HOME/.oh-my-zsh sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
20+
sed -i 's/robbyrussell/eastwood/g' $LOCAL_HOME/.zshrc

devcontainer/update.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
docker build --tag ghcr.io/rsl-org/fedora_devcontainer .
3+
docker push ghcr.io/rsl-org/fedora_devcontainer

0 commit comments

Comments
 (0)