jjnox
V2EX  ›  Docker

Dockefile 姿势问题

  •  1
     
  •   jjnox · Aug 30, 2022 · 1632 views
    This topic created in 1384 days ago, the information mentioned may be changed or developed.
    # one
    FROM golang:1.17 as one
    WORKDIR /src/
    COPY . .
    RUN apt-get update;\
        apt-get install --yes --no-install-recommends make;\
        make build
    ENV PORT=8080
    EXPOSE 8080
    ENTRYPOINT ["./dist/butterfly", "serve"]
    

    可以运行

    # one
    FROM golang:1.17 as one
    WORKDIR /src/
    COPY . .
    RUN apt-get update;\
        apt-get install --yes --no-install-recommends make;\
        make build
    # two
    FROM scratch
    WORKDIR /app/
    COPY --from=one /src/dist/ /app/
    ENV PORT=8080
    EXPOSE 8080
    ENTRYPOINT ["./butterfly", "serve"]
    

    exec /app/butterfly; no such file or directory

    jjnox
        1
    jjnox  
    OP
       Aug 30, 2022
    已解决
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2662 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 05:25 · PVG 13:25 · LAX 22:25 · JFK 01:25
    ♥ Do have faith in what you're doing.