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

Commit 4bfc85a

Browse files
committed
cleanup Dockerfile: put ARGs before FROM, setup ENTRYPOINT at end
1 parent 2e52999 commit 4bfc85a

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

Dockerfile

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
# switch back to Alpine when/if https://bugs.alpinelinux.org/issues/8470 is fixed
2-
# FROM alpine:latest
3-
# RUN apk --update upgrade && apk add bash nfs-utils && rm -rf /var/cache/apk/*
4-
1+
# Alpine can only be used if/when this bug is fixed: https://bugs.alpinelinux.org/issues/8470
52
ARG BUILD_FROM=debian:stretch-slim
63

7-
FROM $BUILD_FROM
8-
94
# https://github.com/ehough/docker-nfs-server/pull/3#issuecomment-387880692
105
ARG DEBIAN_FRONTEND=noninteractive
116

12-
# kmod is required for lsmod
13-
# libcap2-bin is required for checking capabilities
7+
FROM $BUILD_FROM
8+
9+
# kmod is needed for lsmod, and libcap2-bin is needed for confirming Linux capabilities
1410
RUN apt-get update && \
1511
apt-get install -y --no-install-recommends nfs-kernel-server kmod libcap2-bin && \
1612
apt-get clean && \
1713
rm -rf /var/lib/apt/lists && \
18-
rm /etc/idmapd.conf # remove the default idmapd.conf
19-
20-
ADD ./entrypoint.sh /usr/local/bin
21-
RUN chmod +x /usr/local/bin/entrypoint.sh
14+
\
15+
# remove the default idmapd.conf
16+
rm -v /etc/idmapd.conf
2217

2318
# http://wiki.linux-nfs.org/wiki/index.php/Nfsv4_configuration
2419
RUN mkdir -p /var/lib/nfs/rpc_pipefs && \
@@ -28,4 +23,6 @@ RUN mkdir -p /var/lib/nfs/rpc_pipefs && \
2823

2924
EXPOSE 2049
3025

26+
# setup entrypoint
27+
COPY ./entrypoint.sh /usr/local/bin
3128
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

entrypoint.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)