wdssmq
V2EX  ›  Docker

Docker 构建中复制多个文件到目录时为什么有的环境需要目标以 / 结尾?

  •  
  •   wdssmq ·
    wdssmq · Sep 18, 2021 · 1895 views
    This topic created in 1713 days ago, the information mentioned may be changed or developed.

    When using COPY with more than one source file, the destination must be a directory and end with a /

    标准什么的,,,难道要搞个 Dockerfile Lint 之类的东西??? Orz

    AoEiuV020
        1
    AoEiuV020  
       Sep 18, 2021
    加斜杠 /区分文件还是文件夹吧,
    虽然感觉可以做到自动判断,但就使用来说,尽量不要写带歧义的命令,我 copy 目标是目录的话不管是不是多个是不是必须都会带上斜杠 /
    whileFalse
        2
    whileFalse  
       Sep 18, 2021 via iPhone
    你先了解一下 shell 的 cp 命令吧。 你可以在一个 cp 命令里面指定多个源和一个目标目录
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2674 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 15:42 · PVG 23:42 · LAX 08:42 · JFK 11:42
    ♥ Do have faith in what you're doing.