Skip to content

Commit

Permalink
Add user password for bootc
Browse files Browse the repository at this point in the history
  • Loading branch information
gbraad authored Jan 18, 2025
1 parent 41c6ca1 commit 61b291d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build-containers-bootc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
podman build -t ghcr.io/gbraad-devenv/fedora/dotfiles-bootc:41 \
--build-arg=BASE_IMAGE="ghcr.io/gbraad-devenv/fedora/base-bootc" \
--build-arg=BASE_VERSION=41 \
--build-arg=USER_PASSWD="password" \
-f containers/Containerfile-dotfiles .
- name: Run podman build - systemd-bootc
run: |
Expand Down
7 changes: 6 additions & 1 deletion containers/Containerfile-dotfiles
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ ARG BASE_VERSION="41"

FROM ${BASE_IMAGE}:${BASE_VERSION}

ARG USER_PASSSWD

LABEL org.opencontainers.image.source = "https://github.com/gbraad-devenv/fedora"

# Add user with the expected ID (automated setup does not work atm)
RUN useradd -l -u 1000 -G wheel -md /var/home/gbraad -s /bin/bash -p gbraad gbraad \
&& sed -i.bkp -e 's/%wheel\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%wheel ALL=NOPASSWD:ALL/g' /etc/sudoers
&& sed -i.bkp -e 's/%wheel\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%wheel ALL=NOPASSWD:ALL/g' /etc/sudoers \
&& if [ -n "${USER_PASSWD}" ] ; then \
echo "gbraad:${USER_PASSWD}" | sudo chpasswd ; \
fi

USER gbraad

Expand Down

0 comments on commit 61b291d

Please sign in to comment.