Skip to content

Commit 6bbb326

Browse files
committed
Merge PR62
ehough#62
1 parent f97055c commit 6bbb326

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

Dockerfile

+5-7
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ ARG BUILD_FROM=alpine:latest
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 tzdata && \
76
# remove the default config files
8-
rm -v /etc/idmapd.conf /etc/exports
9-
10-
# http://wiki.linux-nfs.org/wiki/index.php/Nfsv4_configuration
11-
RUN mkdir -p /var/lib/nfs/rpc_pipefs && \
12-
mkdir -p /var/lib/nfs/v4recovery && \
7+
rm -v /etc/idmapd.conf /etc/exports && \
8+
# http://wiki.linux-nfs.org/wiki/index.php/Nfsv4_configuration
9+
mkdir -p /var/lib/nfs/rpc_pipefs /var/lib/nfs/v4recovery && \
10+
mkdir /export && chmod a+rwxt /export && \
1311
echo "rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs defaults 0 0" >> /etc/fstab && \
1412
echo "nfsd /proc/fs/nfsd nfsd defaults 0 0" >> /etc/fstab
1513

entrypoint.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ is_kernel_module_loaded() {
273273

274274
is_granted_linux_capability() {
275275

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

@@ -443,6 +443,10 @@ init_exports() {
443443

444444
log "building $PATH_FILE_ETC_EXPORTS from environment variables"
445445

446+
mkdir -p /share && chmod a+rwxt /share
447+
exports='/share *(ro,async,no_subtree_check,no_auth_nlm,insecure,no_root_squash,fsid=root)'
448+
exports=$exports$'\n'
449+
446450
for candidate_export_var in $candidate_export_vars; do
447451

448452
local line="${!candidate_export_var}"
@@ -592,6 +596,10 @@ boot_main_exportfs() {
592596
args+=('-v')
593597
fi
594598

599+
echo 'Generated /etc/exports:'
600+
cat /etc/exports
601+
echo ''
602+
595603
boot_helper_start_daemon 'starting exportfs' $PATH_BIN_EXPORTFS "${args[@]}"
596604
}
597605

0 commit comments

Comments
 (0)