Skip to content

Commit 6d88b3a

Browse files
committed
fix: patch out FileUtils.chown for rootless Alpine containers
The FileUtils.chown calls in openvoxserver-ca fail in rootless containers because the process lacks CAP_CHOWN. The directory ownership is already handled correctly by the g=u / SGID permission pattern. This is the same approach used in the openvox-operator project. Ref: #121
1 parent f9ba621 commit 6d88b3a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

openvoxserver/Containerfile.alpine

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ RUN sed -i 's/^ *USER="puppet"/USER=""/' /etc/default/puppetserver
225225
# reasons. this won't work because after creating a link ruby tries to call chown
226226
RUN sed -i '/Puppetserver::Ca::Utils::Config\.symlink_to_old_cadir/ s/^/# /' \
227227
/usr/lib/ruby/gems/3.4.0/gems/openvoxserver-ca-3.0.0/lib/puppetserver/ca/action/setup.rb
228+
# `FileUtils.chown` calls fail in rootless containers because the process
229+
# lacks CAP_CHOWN. The ownership is already handled by the g=u / SGID pattern above.
230+
RUN sed -i 's/FileUtils\.chown/# FileUtils.chown/' \
231+
/usr/lib/ruby/gems/3.4.0/gems/openvoxserver-ca-3.0.0/lib/puppetserver/ca/utils/file_system.rb
228232

229233
USER puppet:0
230234

0 commit comments

Comments
 (0)