How to specify working directory for ENTRYPOINT in Dockerfile

后端 未结 2 1196
陌清茗
陌清茗 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.

提交回复
热议问题