I am in the process of refactoring and "dockerizing" a legacy application made of shell scripts, C++ binaries, and various open-sources packages (among which httpd)
Is there a way to create, in a docker container, hard links to files located in a docker volume ?
I am planning on architecting containers as follows:
services:
legacy-app:
image: my-legacy-app
volumes:
- http-files:/var/www/html/
httpd:
image: httpd:2.4
volumes:
- http-files:/usr/local/apache2/htdocs/
volumes:
http-files:
Some of the init scripts in the legacy application create hard links in the /var/www/html/ directory pointing to other files in the file system. They now return the following errors :
ln: creating hard link `/var/www/html/1/application' to `/home/conf/application': Invalid cross-device link
I tried with symlinks and it works. However, the reason hard links were chosen here is to have the file removed once all links to it are removed.
Is there a way to create hard links accross docker volumes ?