How do I use a volume created by the docker volume command?

Using Docker 1.9.1, I can create a volume like so

docker volume create --name minecraft-data

Which works just fine

  • How does the Docker assign MAC addresses to containers?
  • nginx+php-fpm docker-compose not work
  • Docker: ping: unknown host yahoo.com
  • How to keep an infinite loop running in order to not close a container in docker
  • Docker old images cleanup?
  • Use consul to export IP and Port to another Docker container dynamically
  • docker volume inspect minecraft-data
    [
        {
            "Name": "minecraft-data",
            "Driver": "local",
            "Mountpoint": "/var/lib/docker/volumes/minecraft-data/_data"
        }
    ]
    

    Then I tried using that volume with --volumes-from but that didn’t work

    docker run --detach --interactive --tty \
      --volumes-from minecraft-data \
      -e VERSION=LATEST \
      -e EULA=TRUE \
      -p 25565:25565 \
      itzg/minecraft-server
    Error response from daemon: Unable to find a node fulfilling all dependencies: --volumes-from=minecraft-data
    

    How do I use a volume created by the docker volume command?

  • Docker Toolbox SSH Login
  • Installing cPhalcon on AWS Docker Image
  • Postgresql DB not getting connected in docker
  • Can't pull image from docker repo
  • How to change location of “.docker” directory
  • How can share Docker Volume UID with my host macOSx
  • One Solution collect form web for “How do I use a volume created by the docker volume command?”

    The docker volume create man page mentions that you are supppose to use that data volume with a mounted path:

    You create a volume and then configure the container to use it, for example:

    $ docker volume create --name hello
    hello
    
    $ docker run -d -v hello:/world busybox ls /world
    

    The mount is created inside the container’s /world directory.

    So you don’t need –volumes-from here: you need to create a bind mount

    - v minecraft-data:/apath
    

    That will allow your container to access data from the volume container minecraft-data in /apath.

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