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:

  • Play framework multiple ajax request
  • How to setup environments for MERN apps
  • Error on Zookeeper cluster mode with Docker?
  • How do I attach to an existing docker-machine (Azure)?
  • Varnish Error: Failed to open (any) accept sockets
  • CPU stats were not captured for docker containers
  • 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:

      build: ./node_js
      command: node server.js
        - mongo
        - mongo      
        NODE_ENV: development  
        - '8080:8080'
        - ./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.

  • Docker build error with vue-cli Webpack boilerplate
  • How to restart docker container without log level?
  • Sonarqube doesn't start from Docker
  • Getting “broken pipe” when building Docker image using boot2docker Mac
  • Can't discover docker container on user defined network
  • Can a Jenkins Pipeline write/configure a separate Jenkins job?
  • 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.