Skip to content
Draft
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [unreleased]

### Fixed
* Broken links in README, both on GitHub and Docker Hub ([#29](https://github.com/ehough/docker-nfs-server/issues/29), [#35](https://github.com/ehough/docker-nfs-server/issues/35))

### Changed
* Use pure Bash for uppercasing strings ([#36](https://github.com/ehough/docker-nfs-server/issues/36))

## [2.2.1] - 2019-03-15

### Fixed
Expand Down
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ This is the only containerized NFS server that offers **all** of the following f
- clean teardown of services upon termination (no lingering `nfsd` processes on Docker host)
- flexible construction of `/etc/exports`
- extensive server configuration via environment variables
- human-readable logging (with a helpful [debug mode](doc/feature/logging.md))
- human-readable logging (with a helpful [debug mode](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/logging.md))
- *optional* bonus features
- [Kerberos security](doc/feature/kerberos.md)
- [NFSv4 user ID mapping](doc/feature/nfs4-user-id-mapping.md) via [`idmapd`](http://man7.org/linux/man-pages/man8/idmapd.8.html)
- [AppArmor](doc/feature/apparmor.md) compatibility
- [Kerberos security](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/kerberos.md)
- [NFSv4 user ID mapping](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/nfs4-user-id-mapping.md) via [`idmapd`](http://man7.org/linux/man-pages/man8/idmapd.8.html)
- [AppArmor](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/apparmor.md) compatibility

## Table of Contents

Expand All @@ -24,16 +24,16 @@ This is the only containerized NFS server that offers **all** of the following f
* [Starting the server](#starting-the-server)
* [Mounting filesystems from a client](#mounting-filesystems-from-a-client)
* Optional features
* [Debug logging](doc/feature/logging.md)
* [Kerberos security](doc/feature/kerberos.md)
* [NFSv4 user ID mapping](doc/feature/nfsv4-user-id-mapping.md)
* [AppArmor integration](doc/feature/apparmor.md)
* [Debug logging](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/logging.md)
* [Kerberos security](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/kerberos.md)
* [NFSv4 user ID mapping](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/nfs4-user-id-mapping.md)
* [AppArmor integration](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/apparmor.md)
* Advanced
* [automatically load required kernel modules](doc/feature/auto-load-kernel-modules.md)
* [custom server ports](doc/advanced/ports.md)
* [custom NFS versions offered](doc/advanced/nfs-versions.md)
* [performance tuning](doc/advanced/performance-tuning.md)
* [Help!](#help!)
* [automatically load required kernel modules](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/auto-load-kernel-modules.md)
* [custom server ports](https://github.com/ehough/docker-nfs-server/blob/develop/doc/advanced/ports.md)
* [custom NFS versions offered](https://github.com/ehough/docker-nfs-server/blob/develop/doc/advanced/nfs-versions.md)
* [performance tuning](https://github.com/ehough/docker-nfs-server/blob/develop/doc/advanced/performance-tuning.md)
* [Help!](#help)
* [Remaining tasks](#remaining-tasks)
* [Acknowledgements](#acknowledgements)

Expand All @@ -48,7 +48,7 @@ This is the only containerized NFS server that offers **all** of the following f

`modprobe {nfs,nfsd,rpcsec_gss_krb5}`

or you can just allow the container to [load them automatically](doc/feature/auto-load-kernel-modules.md).
or you can just allow the container to [load them automatically](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/auto-load-kernel-modules.md).
1. The container will need to run with `CAP_SYS_ADMIN` (or `--privileged`). This is necessary as the server needs to mount several filesystems *inside* the container to support its operation, and performing mounts from inside a container is impossible without these capabilities.
1. The container will need local access to the files you'd like to serve via NFS. You can use Docker volumes, bind mounts, files baked into a custom image, or virtually any other means of supplying files to a Docker container.

Expand Down Expand Up @@ -121,7 +121,7 @@ Let's break that command down into its individual pieces to see what's required

1. **Expose the server ports**

You'll need to open up at least one server port for your client connections. The ports listed in the examples below are the defaults used by this image and most can be [customized](doc/ports.md).
You'll need to open up at least one server port for your client connections. The ports listed in the examples below are the defaults used by this image and most can be [customized](https://github.com/ehough/docker-nfs-server/blob/develop/doc/advanced/ports.md).

* If your clients connect via **NFSv4 only**, you can get by with just TCP port `2049`:

Expand All @@ -145,26 +145,26 @@ If you pay close attention to each of the items in this section, the server shou

## Optional Features

* [Debug logging](doc/feature/logging.md)
* [Kerberos security](doc/feature/kerberos.md)
* [NFSv4 user ID mapping](doc/feature/nfs4-user-id-mapping.md)
* [AppArmor integration](doc/feature/apparmor.md)
* [Debug logging](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/logging.md)
* [Kerberos security](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/kerberos.md)
* [NFSv4 user ID mapping](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/nfs4-user-id-mapping.md)
* [AppArmor integration](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/apparmor.md)

## Advanced

* [automatically load required kernel modules](doc/feature/auto-load-kernel-modules.md)
* [customizing which ports are used](doc/advanced/ports.md)
* [customizing NFS versions offered](doc/advanced/nfs-versions.md)
* [performance tuning](doc/advanced/performance-tuning.md)
* [automatically load required kernel modules](https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/auto-load-kernel-modules.md)
* [customizing which ports are used](https://github.com/ehough/docker-nfs-server/blob/develop/doc/advanced/ports.md)
* [customizing NFS versions offered](https://github.com/ehough/docker-nfs-server/blob/develop/doc/advanced/nfs-versions.md)
* [performance tuning](https://github.com/ehough/docker-nfs-server/blob/develop/doc/advanced/performance-tuning.md)

## Help!

Please [open an issue](https://github.com/ehough/docker-nfs-server/issues) if you have any questions, constructive criticism, or can't get something to work.

## Remaining tasks

- figure out why `rpc.nfsd` takes 5 minutes to startup/timeout unless `rpcbind` is running
- add more examples, including Docker Compose
- figure out why `rpc.nfsd` [takes 5 minutes to startup/timeout](https://www.spinics.net/lists/linux-nfs/msg59728.html) unless `rpcbind` is running
- add more examples

## Acknowledgements

Expand Down
17 changes: 4 additions & 13 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# https://hub.docker.com/r/erichough/nfs-server
# https://github.com/ehough/docker-nfs-server
#
# Copyright (C) 2017-2019 Eric D. Hough
# Copyright (C) 2017-2020 Eric D. Hough
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -75,16 +75,6 @@ readonly STATE_NFS_VERSION='nfs_version'
declare -A state


######################################################################################
### string utils
######################################################################################

toupper() {

echo "$1" | awk '{ print toupper($0) }'
}


######################################################################################
### logging
######################################################################################
Expand All @@ -110,7 +100,7 @@ log_header() {

echo "
==================================================================
$(toupper "$1")
${1^^}
=================================================================="
}

Expand Down Expand Up @@ -341,7 +331,8 @@ assert_port() {
init_state_logging() {

# if the user didn't request a specific log level, the default is INFO
local -r normalized_log_level=$(toupper "${!ENV_VAR_NFS_LOG_LEVEL:-$LOG_LEVEL_INFO}")
local incoming_log_level="${!ENV_VAR_NFS_LOG_LEVEL:-$LOG_LEVEL_INFO}"
local -r normalized_log_level="${incoming_log_level^^}"

if ! echo "$normalized_log_level" | grep -Eq 'DEBUG|INFO'; then
bail "the only acceptable values for $ENV_VAR_NFS_LOG_LEVEL are: DEBUG, INFO"
Expand Down