Mount data volume, then create symbolic link at container creation in docker

When docker-compose creates the container, is it possible to create a symbolic link from volume-mounted directory to another location in container?

I know it can be done in the Dockerfile, but I wont have the data volume mounted at the moment of building the image.

  • How to edit file after I shell to a docker container?
  • Error in Docker overlay folder after replacing mounted folder with a file on the host
  • Mounting ISO images with powershell inside windowsservercore fails
  • Dockerfile works when every line run interactively, but fails using docker build
  • How do you deliver your application using the concept of containers (Docker containers)
  • how to map a local folder as the volume the docker container or image?
  • envsubst command getting stuck in a container
  • How can I filter on Windows-based or Linux-based containers within Docker Hub?
  • Mongodb docker container with client access control
  • Rails delayed job and docker: adding more workers
  • Not able to connect to network inside docker container
  • How to restart a Celery Worker in Airflow
  • One Solution collect form web for “Mount data volume, then create symbolic link at container creation in docker”

    You can create a symbolic link to a file or directory that doesn’t exist. And you can also mount a volume over top of an existing file/directory and the symbolic link will point to the newly mounted contents. So add the link inside your Dockerfile to the image.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.