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

Commit 3c3b580

Browse files
committed
recognize baked-in /etc/exports. fixes obeone#9
1 parent da95219 commit 3c3b580

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
9+
### Fixed
10+
11+
* baked-in `/etc/exports` is not properly recognized ([#9](https://github.com/ehough/docker-nfs-server/issues/9))
12+
713
## [1.1.0] - 2018-06-06
814

915
### Added

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ RUN apt-get update
1212
apt-get clean && \
1313
rm -rf /var/lib/apt/lists && \
1414
\
15-
# remove the default idmapd.conf
16-
rm -v /etc/idmapd.conf
15+
# remove the default config files
16+
rm -v /etc/idmapd.conf /etc/exports
1717

1818
# http://wiki.linux-nfs.org/wiki/index.php/Nfsv4_configuration
1919
RUN mkdir -p /var/lib/nfs/rpc_pipefs && \

entrypoint.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,15 @@ init_trap() {
303303

304304
init_exports() {
305305

306+
# first, see if it's bind-mounted
306307
if mount | grep -Eq "^[^ ]+ on $PATH_FILE_ETC_EXPORTS type "; then
307-
log "$PATH_FILE_ETC_EXPORTS already exists in the container"
308+
log "$PATH_FILE_ETC_EXPORTS is bind-mounted"
309+
return
310+
fi
311+
312+
# maybe it's baked-in to the image
313+
if [[ -f $PATH_FILE_ETC_EXPORTS && -r $PATH_FILE_ETC_EXPORTS && -s $PATH_FILE_ETC_EXPORTS ]]; then
314+
log "$PATH_FILE_ETC_EXPORTS is baked into the image"
308315
return
309316
fi
310317

0 commit comments

Comments
 (0)