Docker Community Forums

Share and learn in the Docker community.

Enabling mount on containers

(Jsolisar) #1

I’ve been using and trying to understand dockers for a few months, and I’ve managed to create and understand much.

Now, I’m trying to set up a GitLab backup server with end-day syncing but I’m having issues mounting the network path.

I’ve read I need to use: --cap-add SYS_ADMIN but here is where I realized I didn’t know as much as I thought.

All results I’ve found around say “docker run --cap-add SYS_ADMIN […]” but… my container is already running and configured so I don’t want to create yet a new one, I’d like to start (restart?) that already configured container WITH mount capabilities

Is there something like > docker run [container-id] -o [options] ??


(Jsolisar) #2

NOTE: I found jpetazzo guide to add containers but doesn’t help me (except maybe to understand what I’m doing wrong)
I want a network volume not a local one. I think I created an NFS volume but now I’m trying to add it to the container

NOTE2: recreating the container with the "–cap-add SYS_ADMIN " doesn’t let me mount either

(Jsolisar) #3

Sorted it out after checking here

My solution ended by recreating the container and run it with --privileged=true. I have installed nfs-common and the NFS share is up and running

Still, I’d love to learn how could I use the volume I created following jpetazzo guide to add it to the current machine

(Eldeberde) #4

Hi, i got it without priviliged mode, but also will need the nfs-common in the docker host, this are the dockerfile lines for that

driver: local
type: “nfs”
o: “addr=IP,hard,proto=tcp,timeo=600,rw,relatime,vers=3,rsize=131072,wsize=131072”
device: “:/volume1”