<small id='8NPt7'></small><noframes id='8NPt7'>

      <tfoot id='8NPt7'></tfoot>

          <bdo id='8NPt7'></bdo><ul id='8NPt7'></ul>
      1. <legend id='8NPt7'><style id='8NPt7'><dir id='8NPt7'><q id='8NPt7'></q></dir></style></legend>
        <i id='8NPt7'><tr id='8NPt7'><dt id='8NPt7'><q id='8NPt7'><span id='8NPt7'><b id='8NPt7'><form id='8NPt7'><ins id='8NPt7'></ins><ul id='8NPt7'></ul><sub id='8NPt7'></sub></form><legend id='8NPt7'></legend><bdo id='8NPt7'><pre id='8NPt7'><center id='8NPt7'></center></pre></bdo></b><th id='8NPt7'></th></span></q></dt></tr></i><div id='8NPt7'><tfoot id='8NPt7'></tfoot><dl id='8NPt7'><fieldset id='8NPt7'></fieldset></dl></div>
      2. Docker:在 Windows 上使用 Docker Toolbox 共享卷

        Docker: Sharing a volume on Windows with Docker Toolbox(Docker:在 Windows 上使用 Docker Toolbox 共享卷)
        <legend id='mqUMQ'><style id='mqUMQ'><dir id='mqUMQ'><q id='mqUMQ'></q></dir></style></legend>
          <bdo id='mqUMQ'></bdo><ul id='mqUMQ'></ul>
          <i id='mqUMQ'><tr id='mqUMQ'><dt id='mqUMQ'><q id='mqUMQ'><span id='mqUMQ'><b id='mqUMQ'><form id='mqUMQ'><ins id='mqUMQ'></ins><ul id='mqUMQ'></ul><sub id='mqUMQ'></sub></form><legend id='mqUMQ'></legend><bdo id='mqUMQ'><pre id='mqUMQ'><center id='mqUMQ'></center></pre></bdo></b><th id='mqUMQ'></th></span></q></dt></tr></i><div id='mqUMQ'><tfoot id='mqUMQ'></tfoot><dl id='mqUMQ'><fieldset id='mqUMQ'></fieldset></dl></div>

          <small id='mqUMQ'></small><noframes id='mqUMQ'>

              <tbody id='mqUMQ'></tbody>

                <tfoot id='mqUMQ'></tfoot>
                • 本文介绍了Docker:在 Windows 上使用 Docker Toolbox 共享卷的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试通过我的 Windows 7 计算机上的 Docker 容器设置开发人员环境.

                  I'm trying to setup a developer environment through a Docker container on my Windows 7 computer.

                  我已经为 Windows 安装了 Docker 工具箱.

                  I've installed Docker toolbox for Windows.

                  我有一张包含 Apache 和 PHP 5.6 的图片,这里是:

                  I have an image with Apache and PHP 5.6 within, and here it is:

                  FROM php:5.6.15-apache
                  
                  RUN apt-get update && apt-get install -y 
                  apt-utils vim git php5-mysql php5-memcache php5-memcached php5-intl 
                  wget
                  RUN apt-get install libapache2-mod-php5 -y -o Dpkg::Options::="--force-confdef"
                  RUN docker-php-ext-install mbstring
                  RUN docker-php-ext-install pdo pdo_mysql
                  RUN apt-get install libcurl4-gnutls-dev -y
                  RUN docker-php-ext-install curl
                  RUN a2enmod rewrite
                  
                  ENV APACHE_RUN_USER myname
                  ENV APACHE_RUN_GROUP www-data
                  ENV APACHE_LOG_DIR /var/log/apache2
                  ENV APACHE_LOCK_DIR /var/lock/apache2
                  ENV APACHE_PID_FILE /var/run/apache2.pid
                  
                  EXPOSE 80
                  
                  COPY php.ini /usr/local/etc/php/php.ini
                  COPY apache-config.conf /etc/apache2/sites-enabled/000-default.conf
                  RUN echo "ServerName 127.0.1.1" >> /etc/apache2/apache2.conf
                  

                  这个镜像已经创建好了,我在 Docker 快速启动终端中运行docker images"就可以看到了.

                  This image is created, and I can see it when I run "docker images" in the Docker quickstart terminal.

                  在我的 apache-config.conf 中,我只有一个很小的虚拟主机,可以通过 index.php 文件访问测试网站.

                  In my apache-config.conf, I just have a tiny virtual host to access a test website with just an index.php file.

                  然后我尝试在 Docker 快速启动终端中创建容器:

                  Then I try to create the container in the Docker quickstart terminal:

                  docker run --name=php5.6_container --rm -v "//c/sites:/var/www/html" -p 80:80 -p 8080:8080 php5.6
                  

                  我收到以下错误:

                  AH00112: Warning: DocumentRoot [/var/www/html/test] does not exist
                  AH00112: Warning: DocumentRoot [/var/www/html/test] does not exist
                  [Tue Dec 08 16:36:37.703143 2015] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) configured -- resuming normal operations
                  [Tue Dec 08 16:36:37.703733 2015] [core:notice] [pid 1] AH00094: Command line: '
                  apache2 -D FOREGROUND'
                  

                  似乎我的音量选项没有被考虑在内.并且没有创建容器.

                  It seems like my volume option is not taken into account. And the container is not created.

                  我做错了什么?

                  推荐答案

                  在 https://docs.docker.com/engine/userguide/dockervolumes/#mount-a-host-directory-as-a-data-音量.特别是:

                  如果您在 Mac 或 Windows 上使用 Docker Machine,您的 Docker 守护程序只能有限地访问您的 OS X 或 Windows 文件系统.Docker Machine 尝试自动共享您的/Users (OS X) 或 C:Users (Windows) 目录.

                  If you are using Docker Machine on Mac or Windows, your Docker daemon has only limited access to your OS X or Windows filesystem. Docker Machine tries to auto-share your /Users (OS X) or C:Users (Windows) directory.

                  基本上,您需要将站点文件移动到 c:Userssites 等位置,然后使用文档中建议的内容进行安装:

                  Basically, you will need to move your site files to somewhere such as c:Userssites and then mount using something like suggested in documentation:

                  docker run --name=php5.6_container --rm -v "/c/Users/sites:/var/www/html" -p 80:80 -p 8080:8080 php5.6
                  

                  这篇关于Docker:在 Windows 上使用 Docker Toolbox 共享卷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                      <tbody id='u2Ctb'></tbody>
                      <bdo id='u2Ctb'></bdo><ul id='u2Ctb'></ul>

                    • <i id='u2Ctb'><tr id='u2Ctb'><dt id='u2Ctb'><q id='u2Ctb'><span id='u2Ctb'><b id='u2Ctb'><form id='u2Ctb'><ins id='u2Ctb'></ins><ul id='u2Ctb'></ul><sub id='u2Ctb'></sub></form><legend id='u2Ctb'></legend><bdo id='u2Ctb'><pre id='u2Ctb'><center id='u2Ctb'></center></pre></bdo></b><th id='u2Ctb'></th></span></q></dt></tr></i><div id='u2Ctb'><tfoot id='u2Ctb'></tfoot><dl id='u2Ctb'><fieldset id='u2Ctb'></fieldset></dl></div>

                      <tfoot id='u2Ctb'></tfoot>

                      <small id='u2Ctb'></small><noframes id='u2Ctb'>

                        <legend id='u2Ctb'><style id='u2Ctb'><dir id='u2Ctb'><q id='u2Ctb'></q></dir></style></legend>