Docker: Mount directory from one container to another

前端 未结 3 1628
执笔经年
执笔经年 2020-12-15 03:42

I have two docker images. One of the docker image (from first container), when ran, generates some files, which needs to be consumed by the another container.

Can I

3条回答
  •  清歌不尽
    2020-12-15 04:20

    It's very simple. You have to share one directory to two different containers, then have both access to the same data in that directory.

    docker run -v myfolder:/data/myfolder image-name-1
    docker run -v myfolder:/data/myfolder image-name-2
    

提交回复
热议问题