久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='wTbBH'><style id='wTbBH'><dir id='wTbBH'><q id='wTbBH'></q></dir></style></legend>

      1. <tfoot id='wTbBH'></tfoot>
      2. <small id='wTbBH'></small><noframes id='wTbBH'>

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

        獲取 Composer(php 依賴管理器)以在 docker 鏡像構(gòu)建上

        Get composer (php dependency manager) to run on a docker image build(獲取 Composer(php 依賴管理器)以在 docker 鏡像構(gòu)建上運行)

            <tbody id='rQpsZ'></tbody>
        • <small id='rQpsZ'></small><noframes id='rQpsZ'>

          <tfoot id='rQpsZ'></tfoot>

            1. <i id='rQpsZ'><tr id='rQpsZ'><dt id='rQpsZ'><q id='rQpsZ'><span id='rQpsZ'><b id='rQpsZ'><form id='rQpsZ'><ins id='rQpsZ'></ins><ul id='rQpsZ'></ul><sub id='rQpsZ'></sub></form><legend id='rQpsZ'></legend><bdo id='rQpsZ'><pre id='rQpsZ'><center id='rQpsZ'></center></pre></bdo></b><th id='rQpsZ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='rQpsZ'><tfoot id='rQpsZ'></tfoot><dl id='rQpsZ'><fieldset id='rQpsZ'></fieldset></dl></div>

                <bdo id='rQpsZ'></bdo><ul id='rQpsZ'></ul>
                <legend id='rQpsZ'><style id='rQpsZ'><dir id='rQpsZ'><q id='rQpsZ'></q></dir></style></legend>
                  本文介紹了獲取 Composer(php 依賴管理器)以在 docker 鏡像構(gòu)建上運行的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  TL;DR 你能給我指出一個使用 composer 處理 PHP 依賴項的 docker 鏡像示例嗎?

                  TL;DR Can you point me to an example of a docker image that uses composer to handle PHP dependencies?

                  我在這篇文章中的所有問題都是關(guān)于 composer php 依賴工具 不是 docker-composer fig 的繼任者em>.

                  All my questions in this post are regarding composer the php dependency tool not docker-composer the successor of fig.

                  我正在嘗試構(gòu)建我自己的 docker 鏡像來運行 WordPress 作為 Composer 依賴項安裝.

                  I'm trying to build my own docker image to run WordPress installed as a composer dependency.

                  我正在使用 docker PHP 鏡像作為基礎(chǔ)構(gòu)建 docker 鏡像,我需要做的是安裝 composer 并在鏡像創(chuàng)建時或鏡像構(gòu)建時運行 composer update 命令(不知道是否兩個都可以).

                  I'm working on building a docker image using docker PHP image as a base and what I need to do is install composer and run a composer update command either on image creation time or on image build time (don't know if both would be ok).

                  我可以通過手動執(zhí)行所有步驟(運行 docker 鏡像,猛擊它,然后復(fù)制和粘貼每一步)來運行一切正常.

                  I can run everything just fine by manually executing all the steps (running a docker image, bashing into it, and copying and pasting every step).

                  但是當(dāng)我將所有這些步驟放在 Dockerfile 上時,我沒有讓 Composer 來編寫文件.

                  But when I put all that steps on a Dockerfile I don't get composer to write the files.

                  一段時間以來,我一直在嘗試獲得最少失敗的示例,但我得到的示例并不是最少的.

                  I've been trying to get a minimum failing example for some time but the one I've got is quite not minimum.

                  我的測試由以下內(nèi)容組成(鏈接到下面的相關(guān) github 存儲庫)

                  My test is composed of the following (links to the relevant github repos below)

                  Dockerfile

                  NFORMATION ~~~#
                  
                  # based on
                  # https://hub.docker.com/r/richarvey/nginx-php-fpm/
                  # and
                  #?https://hub.docker.com/_/wordpress/
                  
                  FROM php:7.0.2-apache
                  
                  MAINTAINER Miquel Adell <miquel@miqueladell.com>
                  
                  ENV WORDPRESS_VERSION 4.4.1
                  
                  
                  
                  #~~~?DEPENDENCIES ~~~#
                  
                  # Add PHP repository to apt source
                  RUN apt-get update 
                      && apt-get install -y 
                          libpng12-dev 
                          libjpeg-dev  
                          curl 
                          sed 
                          zlib1g-dev 
                      && docker-php-ext-install 
                          zip 
                          mysqli
                  
                  RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
                  
                  
                  
                  #~~~ DIRS ~~~#
                  
                  WORKDIR /var/www/html/
                  
                  
                  
                  #~~~ WORDPRESS ~~~#
                  
                  COPY files/composer.json composer.json
                  ONBUILD RUN composer update
                  

                  docker-compose.yml

                  wordpress:
                    image: miqueladell/composed_wordpress_test
                    links:
                      - wordpress_db:mysql
                    environment:
                      - VIRTUAL_HOST=miqueladell.dev
                      - WORDPRESS_DB_NAME=wordpress
                    ports:
                     - "80"
                  
                  wordpress_db:
                    image: miqueladell/mariadb-utf8mb4
                    environment:
                       - MYSQL_ROOT_PASSWORD=password
                  

                  我的測試如下

                  1. 在包含上面粘貼的 Dockerfile 的目錄中構(gòu)建執(zhí)行此命令的映像

                  1. Build an image executing this command in a directory containing the Dockerfile pasted above

                   docker build -t miqueladell/composed_wordpress_test .
                  

                  (日志中沒有錯誤)

                  通過在包含上面粘貼的 docker-compose.yml 的目錄中運行以下命令,使用該圖像構(gòu)建容器

                  Use that image to build a container by running the following command in a directory containing the docker-compose.yml pasted above

                   docker-compose up
                  

                  (日志中沒有錯誤)

                  bash 進入正在運行的容器以查看文件是否存在

                  bash into the running container to be able to see if the files are there

                   docker exec -i -t miqueladellv2_wordpress_1 bash
                  

                1. ls of/var/www/html

                2. ls of /var/www/html

                   root@bff14367658b:/var/www/html# ls -al
                   total 12
                   drwxr-xr-x 2 www-data www-data 4096 Jan 19 10:50 .
                   drwxr-xr-x 5 root     root     4096 Jan 19 10:50 ..
                   -rw-r--r-- 1 root     root      138 Jan 15 09:18 composer.json
                  

                3. 您可以在第 4 步中看到 composer update 似乎根本沒有運行.

                  You can see in step 4 that composer update seems to not have run at all.

                  我都試過

                  RUN composer update
                  

                  ONBUILD RUN composer update
                  

                  在 Dockerfile 上具有相同的結(jié)果.

                  on Dockerfile with the same results.

                  如果我回到測試的前一個步驟 4 并在 docker 容器的 bash 提示符下手動運行 composer update 我得到:

                  If I go back to the previous step 4 of the test and I manually run composer update on the bash prompt of the docker container I get:

                  root@bff14367658b:/var/www/html# composer update
                  Loading composer repositories with package information
                  Updating dependencies (including require-dev)
                    - Installing johnpbloch/wordpress-core-installer (0.2.1)
                      Downloading: 100%
                  
                    - Installing johnpbloch/wordpress (4.4.1)
                      Downloading: 100%
                  
                  Writing lock file
                  Generating autoload files
                  root@bff14367658b:/var/www/html# ls -al
                  total 24
                  drwxr-xr-x 4 www-data www-data 4096 Jan 19 11:12 .
                  drwxr-xr-x 6 root     root     4096 Jan 19 11:12 ..
                  -rw-r--r-- 1 root     root      138 Jan 15 09:18 composer.json
                  -rw-r--r-- 1 root     root     3718 Jan 19 11:12 composer.lock
                  drwxr-xr-x 4 root     root     4096 Jan 19 11:12 vendor
                  drwxr-xr-x 5 root     root     4096 Jan 19 11:12 wordpress
                  root@bff14367658b:/var/www/html#
                  

                  這正是我在第 4 步中期望的輸出

                  which is exactly the output I was expecting on step 4

                  完整文件的github鏈接

                  • Dockerfile 及其依賴項
                  • docker-composer

                  推薦答案

                  像這樣安裝 composer 可以避免這個問題:

                  Installing composer like this will avoid this problem:

                  RUN curl -o /tmp/composer-setup.php https://getcomposer.org/installer 
                  && curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig 
                  # Make sure we're installing what we think we're installing!
                  && php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) !== trim(file_get_contents('/tmp/composer-setup.sig'))) { unlink('/tmp/composer-setup.php'); echo 'Invalid installer' . PHP_EOL; exit(1); }" 
                  && php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer --snapshot 
                  && rm -f /tmp/composer-setup.*
                  

                  這篇關(guān)于獲取 Composer(php 依賴管理器)以在 docker 鏡像構(gòu)建上運行的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標(biāo)不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動程序)
                4. <i id='h85D5'><tr id='h85D5'><dt id='h85D5'><q id='h85D5'><span id='h85D5'><b id='h85D5'><form id='h85D5'><ins id='h85D5'></ins><ul id='h85D5'></ul><sub id='h85D5'></sub></form><legend id='h85D5'></legend><bdo id='h85D5'><pre id='h85D5'><center id='h85D5'></center></pre></bdo></b><th id='h85D5'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='h85D5'><tfoot id='h85D5'></tfoot><dl id='h85D5'><fieldset id='h85D5'></fieldset></dl></div>

                        <bdo id='h85D5'></bdo><ul id='h85D5'></ul>

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

                              <tbody id='h85D5'></tbody>

                          • <legend id='h85D5'><style id='h85D5'><dir id='h85D5'><q id='h85D5'></q></dir></style></legend>

                            <tfoot id='h85D5'></tfoot>

                          • 主站蜘蛛池模板: 国产剧情久久 | 久久久一区二区三区四区 | 亚洲精品久久久一区二区三区 | 久久精品青青大伊人av | 成人毛片视频在线播放 | 99re免费 | 精品久久不卡 | 欧美激情一区二区三区 | 欧美亚洲在线 | 麻豆亚洲 | 热99在线 | 超碰人人艹| 91资源在线| 久久日韩精品一区二区三区 | 黄网站涩免费蜜桃网站 | 日韩中文字幕高清 | 在线不卡视频 | 美女黄18岁以下禁止观看 | 99精品一区二区 | 天天拍天天射 | 久久久青草婷婷精品综合日韩 | 久草新视频 | 国产精品成人av | 欧美久| 日本在线免费看最新的电影 | 蜜月aⅴ免费一区二区三区 99re在线视频 | 区一区二区三在线观看 | 一区二区三区四区在线 | 亚洲444kkkk在线观看最新 | 视频1区 | 国产精品色av | 欧美成人一级 | 日韩av免费在线观看 | 伊人网综合 | 天天操天天操 | 欧美精品在线一区二区三区 | 亚洲欧美在线观看 | 欧美一区二区三区在线观看 | 在线视频国产一区 | 国产在线一区二区三区 | 欧美日韩亚洲一区 |