Docker: Error response from daemon: invalid volume specification: ubuntu

17,169

The paths have to be absolute. There is no current working directory or / assumed. Change it to:

docker run -v $(pwd):/opt -p 8080:8080 -it synedra/hapi_api
Share:
17,169

Related videos on Youtube

Javier Joasimar Palos Flores
Author by

Javier Joasimar Palos Flores

Updated on September 15, 2022

Comments

  • Javier Joasimar Palos Flores
    Javier Joasimar Palos Flores over 1 year

    I have the following issue when I run the command docker run -v $(pwd):opt -p 8080:8080 -it synedra/hapi_api:

    docker: Error response from daemon: invalid volume specification: '/home/joasimar/trai/new:opt': invalid mount config for type "bind": invalid mount path: 'opt' mount path must be absolute.

    How can I fix this?

    • Zeinab Abbasimazar
      Zeinab Abbasimazar over 6 years
      You have to set an absolute path for the destination directory when using volumes. BTW read the documentations comprehensively before posting a question.
  • Olasunkanmi
    Olasunkanmi over 2 years
    This is Oct. 2021 and all I can say is: thanks so much. You saved me sleepless nights