V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
weishao666
V2EX  ›  问与答

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

  •  
  •   weishao666 · Mar 21, 2023 · 1052 views
    This topic created in 1137 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
        1
    lhbc  
       Mar 21, 2023
    第 3 行不是告诉你原因了吗
    weishao666
        2
    weishao666  
    OP
       Mar 21, 2023
    @lhbc 进容器里边咋就有呢
    MoonWalker
        3
    MoonWalker  
       Mar 21, 2023
    docker exec f2be0d6fa21c sh -c 'which go' 不就知道有没有了吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   811 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 22:30 · PVG 06:30 · LAX 15:30 · JFK 18:30
    ♥ Do have faith in what you're doing.