Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest alpine changes output of capability #62

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ ARG BUILD_FROM=alpine:latest

FROM $BUILD_FROM

RUN apk --update --no-cache add bash nfs-utils && \
\
RUN apk --update --no-cache add bash nfs-utils tzdata && \
# remove the default config files
rm -v /etc/idmapd.conf /etc/exports

# http://wiki.linux-nfs.org/wiki/index.php/Nfsv4_configuration
RUN mkdir -p /var/lib/nfs/rpc_pipefs && \
mkdir -p /var/lib/nfs/v4recovery && \
rm -v /etc/idmapd.conf /etc/exports && \
# http://wiki.linux-nfs.org/wiki/index.php/Nfsv4_configuration
mkdir -p /var/lib/nfs/rpc_pipefs /var/lib/nfs/v4recovery && \
mkdir /export && chmod a+rwxt /export && \
echo "rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs defaults 0 0" >> /etc/fstab && \
echo "nfsd /proc/fs/nfsd nfsd defaults 0 0" >> /etc/fstab

Expand Down
13 changes: 10 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,13 @@ is_kernel_module_loaded() {

is_granted_linux_capability() {

if capsh --print | grep -Eq "^Current: = .*,?${1}(,|$)"; then
if capsh --has-p=${1} || capsh --has-p=cap_${1}; then
return 0
fi

return 1
}


######################################################################################
### runtime configuration assertions
######################################################################################
Expand Down Expand Up @@ -443,6 +442,10 @@ init_exports() {

log "building $PATH_FILE_ETC_EXPORTS from environment variables"

mkdir -p /share && chmod a+rwxt /share
exports='/share *(ro,async,no_subtree_check,no_auth_nlm,insecure,no_root_squash,fsid=root)'
exports=$exports$'\n'

for candidate_export_var in $candidate_export_vars; do

local line="${!candidate_export_var}"
Expand Down Expand Up @@ -592,6 +595,10 @@ boot_main_exportfs() {
args+=('-v')
fi

echo 'Generated /etc/exports:'
cat /etc/exports
echo ''

boot_helper_start_daemon 'starting exportfs' $PATH_BIN_EXPORTFS "${args[@]}"
}

Expand Down