Docker Community Forums

Share and learn in the Docker community.

Very esoteric volume use case: hard links and multiple volumes


#1

I’m trying to get a handle on approaches to an extreme edge case for volumes.

I’m dockerizing a set of applications at my organization. They require access to 2 locations on the docker host

/opt/OrganziationName/inputs/ -> /network/mounted/drive/A/inputs
and
/opt/OrganizationName/outputs/ -> /network/mounted/drive/A/outputs

but explicitly cannot have the folder
/opt/OrganizationName/SecureHostSpecificStuff/
mounted on the docker image.

Normally,
docker run -v inputs:inputs -v outputs:outputs image:tag command
would suffice.

But the application being dockerized creates a hard link from input to output, and even though on the host the two volumes are on the same physical disk, to the docker container, they are treated as two different phsyical devices and the application crashes while making the hard link.

I’ve tried mounting as a volume and a mount point, but I’m not sure what other approaches are even possible.