Linking custom container on wercker

76 Views Asked by At

I create a container in docker and with 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

box ujwaldhakal/laravel won't work if used php it will work. There were no any good docs for linking the custom container on wercker.

1

There are 1 best solutions below

0
On

Short Version

Have you tried adding a tag after the box id? That solved the issue for me under similar circumstances. Otherwise the image has not (yet) been built and/or pushed to Docker Hub.

Long Version

I had a similar problem. I wanted to use the dealerdirect/ci-php box

So I changed my wercker.yml to use it:

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

But then the build failed:

screenshot of failing build

The "setup environment" step had the error "no such image":

enter image description here

After some experimenting it turned out I needed to add a "tag":

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

After that the docker image was pulled fine and the build continued working again:

enter image description here

Of course, this only works if the images actually exists on Docker Hub. If it does not, you will have to push it manually or set up automated building.