1

我有我的本地开发文件G:\www\project,我Dockerfile的放在G:\www\project\Dockerfile.

目前没有办法docker build -t app .,我的 Dockerfile 是这样的:

FROM ubuntu:14.10

RUN apt-get update && apt-get upgrade -y --force-yes && apt-get -y install software-properties-common --force-yes
RUN locale-gen pt_BR.UTF-8 
ENV LANG pt_BR.UTF-8 
ENV LC_ALL pt_BR.UTF-8

ENV DEBIAN_FRONTEND noninteractive

RUN add-apt-repository -y ppa:nginx/stable 
RUN add-apt-repository -y ppa:ondrej/php5
RUN apt-get -y install nginx php5-fpm php5-mysql php-apc php5-mcrypt php5-gd

RUN echo "cgi.fix_pathinfo = 0;" >> /etc/php5/fpm/php.ini

ADD https://raw.github.com/h5bp/server-configs-nginx/master/h5bp/location/expires.conf /etc/nginx/conf/expires.conf 
ADD https://raw.github.com/h5bp/server-configs-nginx/master/h5bp/directive-only/x-ua-compatible.conf /etc/nginx/conf/x-ua-compatible.conf 
ADD https://raw.github.com/h5bp/server-configs-nginx/master/h5bp/location/cross-domain-fonts.conf /etc/nginx/conf/cross-domain-fonts.conf 
ADD https://raw.github.com/h5bp/server-configs-nginx/master/h5bp/location/protect-system-files.conf /etc/nginx/conf/protect-system-files.conf

RUN mkdir /srv/www

ADD ./docker/default /etc/nginx/sites-available/default 
ADD ./docker/nginx.conf /etc/nginx/nginx.conf

RUN sed -i -e '/access_log/d' /etc/nginx/conf/expires.conf 
RUN sed -i -e 's/^listen =.*/listen = \/var\/run\/php5-fpm.sock/' /etc/php5/fpm/pool.d/www.conf

ADD ./docker/start.sh /start.sh

ADD ./application /srv/www/application 
ADD ./bower_components /srv/www/bower_components 
ADD ./content /srv/www/content 
ADD ./javascripts /srv/www/javascripts 
ADD ./modules /srv/www/modules 
ADD ./stylsheets /srv/www/stylesheets 
ADD ./system /srv/www/system 
ADD ./index.php /srv/www/index.php

EXPOSE 80 443
RUN chmod +x /start.sh

ENTRYPOINT ["/start.sh"]

我已经看到了 OSX 的解决方法,但没有看到 Windows 的解决方法。尝试将 VirtualBox Guest Additions 安装到 tinycorelinux,但它没有将映像挂载到 sr0

4

1 回答 1

0

是的,目前没有 Windows 支持的 Docker 客户端(尽管它正在开发中)

并且 iirc,Boot2Docker 1.3 被硬编码以假设您的用户目录已打开C::/

所以快速到达那里的最佳解决方案是将文件scp到vm,然后在那里运行构建。

(来自G:\Users\project

$ scp * docker@$(boot2docker ip):~/ $ boot2docker ssh $$ docker build -t app . $$ docker run --rm -it app bash

于 2014-12-01T07:00:25.553 回答