forked from flaccid/docker-nfs-client
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
36 lines (31 loc) · 1.37 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM alpine:latest
LABEL org.opencontainers.image.authors="d3fk"
LABEL org.opencontainers.image.source="https://github.com/Angatar/docker-nfs-client.git"
LABEL org.opencontainers.image.url="https://github.com/Angatar/docker-nfs-client"
# USAGE
# $ docker build -t nfs-client .
# $ docker run -it --privileged=true --net=host -v vol:/mnt/nfs-1:shared -e SERVER=X.X.X.X -e SHARE=shared_path nfs-client
# or detached:
# $ docker run -itd --privileged=true --net=host -v vol:/mnt/nfs-1:shared -e SERVER=X.X.X.X -e SHARE=shared_path nfs-client
# or with some more options:
# $ docker run -itd \
# --name nfs-vols \
# --restart=always \
# --privileged=true \
# --net=host \
# -v /mnt/host:/mnt/container \
# -e SERVER=192.168.0.9 \
# -e SHARE=movies \
# -e MOUNT_OPTIONS="nfsvers=3,ro" \
# -e FSTYPE=nfs \
# -e MOUNTPOINT=/mnt/host/mnt/nfs-1 \
# nfs-client
#to enable nfs4 simply switch the FSTYPE to nfs4 and set nfsvers=4
ENV FSTYPE nfs
ENV MOUNT_OPTIONS nfsvers=3
ENV MOUNTPOINT /mnt/nfs-1
RUN apk upgrade --no-cache && apk add --no-cache nfs-utils \
# https://github.com/rancher/os/issues/641#issuecomment-157006575
&& rm /sbin/halt /sbin/poweroff /sbin/reboot
ADD entry.sh /usr/local/bin/entry.sh
ENTRYPOINT ["/usr/local/bin/entry.sh"]