weishao666
V2EX  ›  问与答

docker bash -c 为什么很多命令执行不了

  •  
  •   weishao666 · Mar 21, 2023 · 1460 views
    This topic created in 1326 days ago, the information mentioned may be changed or developed.

    我进到一个容器之后

    cd /zq/app/aiforge; TAGS="bindata" make build
    

    可以正常打包,为什么在宿主机上不行呢,很多的命令都会有这个问题,困扰好久了,跟 bash ,sh 有啥关系?

    docker exec f2be0d6fa21c sh -c 'cd /zq/app/pengcheng/aiforge; TAGS="bindata" make build'
    

    23

    3 replies  •  2023-03-21 16:44:25 +08:00
    lhbc
    lhbc
    Mar 21, 2023
    1
    第 3 行不是告诉你原因了吗
    weishao666
    weishao666
    OP
    Mar 21, 2023
    2
    @lhbc 进容器里边咋就有呢
    MoonWalker
    MoonWalker
    Mar 21, 2023
    3
    docker exec f2be0d6fa21c sh -c 'which go' 不就知道有没有了吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   986 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 22:58 · PVG 06:58 · LAX 14:58 · JFK 17:58
    ♥ Do have faith in what you're doing.