Skip to content

Commit

Permalink
Add workaround to run sudo in container
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenkumar committed Jan 30, 2025
1 parent 1783512 commit 6ef284d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions create-microshift-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ echo "Building image for architecture: $ARCH using repository: $REPO"
git clone https://github.com/openshift/microshift
pushd microshift

# https://github.com/openshift/microshift/pull/4494
sed -i '/RUN useradd -m -s \/bin\/bash microshift -d \/microshift && \\/!b;n;c\ echo '\''microshift ALL=(ALL) NOPASSWD: ALL'\'' >\/etc\/sudoers.d\/microshift \&\& \\\n chmod 0640 \/etc\/shadow' "${CONTAINERFILE}"

# Build the image
podman build \
--build-arg OKD_REPO="$REPO" \
Expand Down

0 comments on commit 6ef284d

Please sign in to comment.