Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit e2bdf81

Browse files
authored
libcap binaries missing (obeone#3)
* alpine version cappimg + fixing missing libcap bin * Improved method to check SYS_ADMIN capability
1 parent 91d85fa commit e2bdf81

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
ARG BUILD_FROM=alpine:latest
1+
ARG BUILD_FROM=alpine:3.17
22

33
FROM $BUILD_FROM
44

5-
RUN apk --update --no-cache add bash nfs-utils && \
6-
\
5+
RUN apk --update --no-cache add bash nfs-utils libcap-utils && \
76
# remove the default config files
87
rm -v /etc/idmapd.conf /etc/exports
98

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ is_kernel_module_loaded() {
277277

278278
is_granted_linux_capability() {
279279

280-
if capsh --print | grep -Eq "^Current: = .*,?${1}(,|$)"; then
280+
if capsh --decode=$(grep CapBnd /proc/$$/status|cut -f2) | grep cap_sys_admin > /dev/null; then
281281
return 0
282282
fi
283283

0 commit comments

Comments
 (0)