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.

  • Bind Docker to a Unix socket under upstart in kubernetes master node
  • docker compose vs docker run - node container
  • How do I use docker on Win 8.1 (boot2docker) both behind a proxy and without a proxy?
  • DOCKER_OPTS in /etc/default/docker ignored
  • Docker Lamp Centos7: '/bin/sh -c systemctl start httpd.service' returned a non-zero code: 1
  • Running magellan on pyspark-notebook docker container
  • How i can build container by docker-compose.yml environment variable?
  • Docker environment variable and Django database setup
  • Docker oracle database fails when starting after commiting
  • Logs not being flushed to Elasticsearch container through Fluentd
  • PyCharm giving Static path imports errors when using Docker
  • Installing an uptodate version of Mono on Ubuntu using docker
  • 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.