0

This question is related to docker-compose not related to Mount directory in Container and share with Host , How to mount a directory inside a docker container on Linux host What i want is sharing docker executables in hosts machine (Mac), Suppose I have a path in docker container /usr/bin/aria2c, Want to share it to host, so it can be globally used by terminal or any app.

My Docker-compose.yml

version: "2.0"
services:
    slate:
        container_name: Aria
        image: abcminiuser/docker-aria2-with-webui
        restart: always
        ports:
          - 6800:6800
          - 6880:80
        environment:
          - UID=100
          - GID=1001
        volumes:
          - /Users/rahul/Downloads:/data  #Where Real Downloads Happen
          - /Users/rahul:/usr/bin/aria2c  #point exectable to home dir

Output :

ERROR: for slate  Cannot start service slate: b'OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \\"rootfs_linux.go:58: mounting \\\\\\"/Users/rahul\\\\\\" to rootfs \\\\\\"/var/lib/docker/overlay2/7e712f0c3f26b123000d74b9d7e4f6109e724eb8d30329c22925ba728793db12/merged\\\\\\" at \\\\\\"/var/lib/docker/overlay2/7e712f0c3f26b123000d74b9d7e4f6109e724eb8d30329c22925ba728793db12/merged/usr/bin/aria2c\\\\\\" caused \\\\\\"not a directory\\\\\\"\\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

I know file is not available in the hosts, But Is there a method to let boot the container and then symlink container executable to host.

Rahul Sharma
  • 779
  • 2
  • 12
  • 27
  • 4
    Possible duplicate of [Mount directory in Container and share with Host](https://stackoverflow.com/q/31726407/608639), [How to mount a directory inside a docker container on Linux host](https://stackoverflow.com/q/40043887/608639), etc. – jww Jun 10 '18 at 04:44
  • @jww this is not about mounting directory it is about mounting a single file – Rahul Sharma Jun 10 '18 at 05:09
  • @RahulSharma interesting read: https://github.com/docker/compose/issues/424 – VonC Jun 10 '18 at 05:20

0 Answers0