链接自定义容器在wercker上

时间:2016-12-19 09:53:59

标签: php docker continuous-integration containers wercker

我在docker中使用id / name i

创建一个容器
box: ujwaldhakal/laravel
build:
  steps:
    - install-packages:
        packages: git
    - script:
        name: install phpunit
        code: |-
          curl -L https://phar.phpunit.de/phpunit.phar -o /usr/local/bin/phpunit
          chmod +x /usr/local/bin/phpunit
    - script:
        name: install composer
        code: curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
    - script:
        name: install dependencies
        code: composer install --no-interaction
    - script:
        name: PHPUnit integration tests
        code: phpunit --configuration phpunit.xml
盒子ujwaldhakal / laravel如果使用了php它会起作用。没有任何好的文档可以在wercker上链接自定义容器。

1 个答案:

答案 0 :(得分:0)

短版

您是否尝试在框ID后添加标记?在类似的情况下,这解决了我的问题。否则,图像尚未(尚未)构建和/或推送到Docker Hub。

长版

我有类似的问题。我想使用dealerdirect/ci-php box

所以我更改了wercker.yml以使用它:

box:
  id: dealerdirect/ci-php
# ...

但是构建失败了:

screenshot of failing build

“设置环境”步骤出现错误“没有这样的图像”:

enter image description here

经过一些实验后发现我需要添加一个“标签”:

box:
  id: dealerdirect/ci-php:5.6
# ...

之后,码头图像被拉得很好,构建继续工作:

enter image description here

当然,只有在Docker Hub上实际存在的图像时,这才有效。如果没有,则必须手动推动或设置自动构建。