Docker的窗口版本无法将本地目录装载到容器上的ubuntu映像?
我有一个docker映像设置,可以在Ubuntu映像(一个容器)上运行NGINX。在运行时,我希望在打开Docker映像时按如下方式装载目录Docker的窗口版本无法将本地目录装载到容器上的ubuntu映像?,ubuntu,nginx,docker,dockerfile,Ubuntu,Nginx,Docker,Dockerfile,我有一个docker映像设置,可以在Ubuntu映像(一个容器)上运行NGINX。在运行时,我希望在打开Docker映像时按如下方式装载目录 docker run -v C:/Docker/webroot:/var/www/html -p 8080:80 --name default nginx_image 但是,当我查看日志时,上面的命令给了我以下错误 [20:18:03.853][ApiProxy][Info]将挂载C:/Docker/webroot:/var/www/html(volum
docker run -v C:/Docker/webroot:/var/www/html -p 8080:80 --name default nginx_image
但是,当我查看日志时,上面的命令给了我以下错误
[20:18:03.853][ApiProxy][Info]将挂载C:/Docker/webroot:/var/www/html(volumeDriver=)重写为/C/Docker/webroot:/var/www/html
[20:18:03.870][ApiProxy][Info]无法转到[snapshots C99A6D868EDA09BF52542988015EF5676B2015B ro com.docker.driver.amd64-linux proxy http]9p:没有此类文件或目录
我尝试了不同的方法来写入窗口路径,但没有任何帮助。我还通过登录Docker image/var/www/html目录进行了检查
其他信息:
构建映像时,我的Dockerfile如下所示:
#Download base image ubuntu 16.04
FROM ubuntu:16.04
# Update Software repository
RUN apt-get update
# Install nginx, php-fpm and supervisord from ubuntu repository
RUN apt-get install -y nginx php7.0-fpm supervisor && \
rm -rf /var/lib/apt/lists/*
#Define the ENV variable
ENV nginx_vhost /etc/nginx/sites-available/default
ENV php_conf /etc/php/7.0/fpm/php.ini
ENV nginx_conf /etc/nginx/nginx.conf
ENV supervisor_conf /etc/supervisor/supervisord.conf
# Enable php-fpm on nginx virtualhost configuration
COPY default ${nginx_vhost}
RUN sed -i -e 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' ${php_conf} && \
echo "\ndaemon off;" >> ${nginx_conf}
#Copy supervisor configuration
COPY supervisord.conf ${supervisor_conf}
RUN mkdir -p /var/www/html && \
mkdir -p /run/php && \
chown -R www-data:www-data /var/www/html && \
chown -R www-data:www-data /run/php
# Volume configuration
VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"]
# Configure Services and Port
COPY start.sh /start.sh
CMD ["./start.sh"]
EXPOSE 80 443
它在没有卷装载的情况下工作吗?docker设置是否将C驱动器包括在共享驱动器列表中?嗯,看起来还有其他问题。即使我删除了-v C:/Docker/webroot:/var/www/html并共享了YES C驱动器,它也不起作用。我已经用我的Docker构建文件更新了我的问题。也许还有更多的线索@BMitchPlease检查sed命令是否正确?发现问题,这是由于我编写脚本的窗口回车#/宾/什。谢谢你的帮助@饶