Docker run command, volumes error

I’m trying to make a docker run and build command out of the compose file below.

So far I have come up with this:

  • connect via ssh to jhipster docker container on CentOS 7
  • Why do I see the postgres process when I run top although it is running only inside Docker?
  • guacamole You do not have permission to access this connection"
  • How to map volume paths using Docker's --volumes-from?
  • Is it possible to mount an ISO inside a docker container? [closed]
  • Docker : Linking containers on different host machines
  • docker build --tag testenvironment/nodejs ./node_js
    docker run -p 8080:8080 -v ./node_js:/home/app/chat -v /home/app/chat/node_modules --name nodejs testenvironment/nodejs
    

    I’m stuck here because it gives the following error:

    C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: create ./node_js: "./node_js" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intented to pass a host directory, use absolute path. See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.
    

    Compose file:

    node:
      build: ./node_js
      command: node server.js
      depends_on:
        - mongo
      links:
        - mongo      
      environment:
        NODE_ENV: development  
      ports:
        - '8080:8080'
      volumes:
        - ./node_js:/home/app/chat
        - /home/app/chat/node_modules
    

    Can anybody tell me how to convert the volumes from the compose file to a docker run command? Thanks in advance.

    I am using the Docker Toolbox for Windows 10.

  • How do we set the the RAM and disk space for a docker container?
  • Forwarding domains to docker containers
  • Sending build context to Docker daemon (it doesn't stop)
  • How to access a Tensorflow docker instance from the “outside” without Jupyter - for distributed Tensorflow
  • How to create populated MySQL Docker Image on build time
  • How to run a shell script using dockerfiles CMD
  • 2 Solutions collect form web for “Docker run command, volumes error”

    This part:

    docker run -p 8080:8080 -v ./node_js:/home/app/chat ....
    

    Should be:

    docker run -p 8080:8080 -v $(pwd)/node_js:/home/app/chat
    

    docker run requires an absolute path for volumes (as a difference from compose)

    Had to use an absolute path but in the following format:
    docker run -p 8080:8080 -v //c/users/desktop/path/to/node_js:/home/app/chat ….

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