wdssmq
V2EX  ›  Docker

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

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