代码之家  ›  专栏  ›  技术社区  ›  Jonny Phelps

Docker run:多行

  •  0
  • Jonny Phelps  · 技术社区  · 8 年前

    "docker run -v .. --name .. --entrypoint .. <image_name>"
    

    像这样的

    "docker run 
    -v. ..
    --name ..
    --entrypoint ..
    <image_name>"
    

    编辑变得很痛苦!谢谢,乔尼

    编辑:我试过在^命令中添加,它不起作用。只是错误 "docker run" requires at least 1 argument.

    2 回复  |  直到 8 年前
        1
  •  2
  •   fly2matrix    8 年前

    我认为最好的工具是docker compose,它使用docker-compose.yml文件来准备运行或构建指令。

    因此,它将是一个yml或yaml格式的文本文件,并采取不同的关键字为它的准备参考。

    https://docs.docker.com/compose/overview/

    Compose is a tool for defining and running multi-container Docker applications.  
    With Compose, you use a YAML file to configure your application’s services.   
    Then, with a single command, you create and start all the services from your configuration.   
    To learn more about all the features of Compose, see the list of features.
    
        2
  •  1
  •   fawr    7 年前

    如果使用dos(即不是powershell) 替换字符 linux的docker命令末尾的空格和反斜杠 i、 e.除了倒数第二行之外,所有行末尾的空格和插入符号似乎都对我有用。

    推荐文章