Add bind mount to Dockerfile just like volume

后端 未结 3 1926
青春惊慌失措
青春惊慌失措 2021-02-01 04:38

I want to add the bind mount to docker file just like I initialise a volume inside Dockefile. Is there any way for it?

3条回答
  •  抹茶落季
    2021-02-01 05:05

    Simple answer is no.

    A basic design principle for docker images is portablility. Bind mounts are hosts specific since the mounted folder is defined on the host machine. Thus this contradicts with the portablility requirement for Docker images.

提交回复
热议问题