SSHFS Mount for Docker Container / Node Server needs to access files on an external server

How do I execute a SSHFS Mount to mount a volume on a different server into my docker image / docker container ?

The docker container contains a simple NodeJS web server. This web-page displays pictures. I have to get those image-files from a different server with different IP.

  • docker-compose.yml file behaves differently on ECS than local docker-compose
  • What is causing these directories to be hidden?
  • How to debug multiple processes running in a Docker container?
  • Network name of containers on multiple bridges
  • NPM install error running Docker on CentOS
  • Listing all version numbers of docker image
  • So far I had this without a docker container. For this I had a CronJob which executes the SSHFS mount to my system. Then the NodeJS server had the files and I was able to display the pictures.

    Now I have to do the same with a docker container. I’d like to have the volume inside the container but I don’t think that it works with the docker run -v /path/ [...] because this would require that I have the files on the host that the container lies in.

    Is it possible to add the SSHFS mount into the docker run command or the Dockerfile ? Are there any other alternatives ?

    ~ cat Dockerfile
    FROM node:alpine
    RUN mkdir -p /usr/src/app
    WORKDIR /usr/src/app
    COPY package.json /usr/src/app/
    RUN npm install
    COPY . /usr/src/app
    EXPOSE 80
    CMD [ "npm", "start" ]

  • Cannot Install R Packages in Docker Image
  • Maven-Wrapper in jHipster inside Docker-Container: FileNotFoundException
  • Passing a docker container's generated name to another container in docker-compose
  • Spring boot app location inside docker container
  • Symfony2 app slow response on MacOS & Boot2Docker
  • IBM Container - su :cannot create child process: Resource temporarily unavailable
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.