How to specify working directory for ENTRYPOINT in Dockerfile

后端 未结 2 1198
陌清茗
陌清茗 2021-02-05 04:22

The Docker image (Windows-based) includes an application directory at C:\\App. Inside that directory reside several sub-folders and files, including a batch file ca

相关标签:
2条回答
  • 2021-02-05 04:48

    If /App is a mounted volume then you should specify VOLUME /App before WORKDIR to use it with ENTRYPOINT, otherwise it does not be seen by ENTRYPOINT:

    VOLUME ["/App"]
    WORKDIR /App
    ENTRYPOINT ["sh", "start.sh"]
    

    Which start.sh is within /App directory.

    0 讨论(0)
  • 2021-02-05 04:50

    WORKDIR /App is a command you can use in your dockerfile to change the working directory.

    0 讨论(0)
提交回复
热议问题