【发布时间】:2018-11-22 19:04:23
【问题描述】:
我正在编写一个 Docker 文件,我的要求是将容器内文件夹的内容复制到本地主机。我怎样才能做到这一点?
FROM ubuntu
RUN apt-get update && apt-get install -y apache2 && apt-get install nginx -y
#COPY resources /var/www/html/
#VOLUME /var/www/html:/var/www/html
COPY /var/www/html/ /var/www/html/
CMD ["nginx", "-g", "daemon off;"]
【问题讨论】:
-
在构建
docker run -v <your_folder_inside>, and after that your host dir/var/lib/docker/volumes/`之后,您是否尝试过使用 VOLUME <your_folder_inside>?
标签: docker dockerfile