docker挂载卷时说不是绝对路径怎么解决

跟着官方文档走的,到这里出错了

img


,有没有朋友解答一下,谢谢了,找了半天实在是没找到解决办法

使用以下方式挂载:-v 宿主目录:容器中目录

  • 帮你找了个相似的问题, 你可以看下: https://ask.csdn.net/questions/7656852
  • 我还给你找了一篇非常好的博客,你可以看看是否有帮助,链接:全网最全最直白最详细Docker教程总结(是什么?有什么用、怎么安装?怎么配置?怎么用?常见报错解决~)——适用于无基础的入门小白运维
  • 除此之外, 这篇博客: docker容器自动重启中的 在使用容器部署应用时,有时候需要设置容器在异常退出后的重启策略,有如下办法: 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:
    • 启动容器时指定重启策略
    docker run --restart=always -d nginx
    
    • 更新已存在容器重启策略
    docker update --restart=always  7aab
    

    Docker supports the following restart policies:

    PolicyResult
    noDo not automatically restart the container when it exits. This is the default.
    on-failure[:max-retries]Restart only if the container exits with a non-zero exit status. Optionally, limit the number of restart retries the Docker daemon attempts.
    alwaysAlways restart the container regardless of the exit status. When you specify always, the Docker daemon will try to restart the container indefinitely. The container will also always start on daemon startup, regardless of the current state of the container.
    unless-stoppedAlways restart the container regardless of the exit status, including on daemon startup, except if the container was put into a stopped state before the Docker daemon was stopped.
  • 您还可以看一下 李振良老师的 Docker入门与进阶实战(上)课程中的 为什么用容器?解决了什么问题?小节, 巩固相关知识点