Skip to content
This repository has been archived by the owner on Mar 13, 2019. It is now read-only.

Container does not work in Gitlab CI Runner #91

Open
derhasi opened this issue Jul 7, 2016 · 7 comments
Open

Container does not work in Gitlab CI Runner #91

derhasi opened this issue Jul 7, 2016 · 7 comments

Comments

@derhasi
Copy link

derhasi commented Jul 7, 2016

When trying to use composer/composer:php5-alpine in Gitlab CI, there is some odd error occuring:

The .gitlab-ci.yml looks like this:

image: composer/composer:php5-alpine
stages:
  - build
  - test
  - deploy
# Jobs
satis-build:
  stage: build
  script:
    - ls

and creates a build output like this:

gitlab-ci-multi-runner 1.3.2 (0323456)
Using Docker executor with image composer/composer:php5-alpine ...
Pulling docker image composer/composer:php5-alpine ...
Running on runner-420782f7-project-64-concurrent-0 via build-runner-githost...
Fetching changes...
HEAD is now at 8d19828 More tests
From https://gitlab.undpaul.de/undpaul/packages
   8d19828..9141eee  master     -> origin/master
Checking out 9141eee5 as master...


  [Symfony\Component\Console\Exception\RuntimeException]  
  The "-c" option does not exist.                         


show [--all] [-i|--installed] [-p|--platform] [-a|--available] [-s|--self] [-N|--name-only] [-P|--path] [-t|--tree] [-l|--latest] [-o|--outdated] [-D|--direct] [--] [<package>] [<version>]



  [Symfony\Component\Console\Exception\RuntimeException]  
  The "-c" option does not exist.                         


show [--all] [-i|--installed] [-p|--platform] [-a|--available] [-s|--self] [-N|--name-only] [-P|--path] [-t|--tree] [-l|--latest] [-o|--outdated] [-D|--direct] [--] [<package>] [<version>]


ERROR: Build failed: exit code 1
@RobLoach
Copy link
Owner

RobLoach commented Jul 7, 2016

Interesting, perhaps it's running a show command with -c in there?

@sylus
Copy link
Contributor

sylus commented Jul 7, 2016

I am successfully using this container in a Drone CI setup, so I am thinking GitLab is most assuredly doing something funky here ^_^

@derhasi
Copy link
Author

derhasi commented Jul 7, 2016

It has to be project independent, as I run the same .gitlab-ci.yml on an empty project. The only "script" that is/will be called is ls. So I do not know where the composer show command is coming from.

@cconover
Copy link

I'm seeing this same issue. This is all I have for the composer part of my build:

composer:
    stage: build
    image: composer/composer
    artifacts:
        paths:
            - vendor/
    cache:
        key: "$CI_BUILD_REF_NAME"
        paths:
            - vendor/
    script:
        - install --prefer-dist

@fbourigault
Copy link

gitlab-ci requires that used images provide a shell entry point as the runner build a bash script to be run into the container.

@BastienM
Copy link
Contributor

IMO it is Gitlab-CI that should adapts itself to how Docker image works and not the other way around.

Most of the available images uses a CMD directive pointing directly to a binary and you cannot asks for every single one of them to changes this behavior in order to be compliant to how Gitlab-CI works.

On that matter, there is still an opened discussion on their repo.

For now the best approach to solve this problem would be to create a new image with composer as its base and change the entrypoint by a script as stated in the PR #116.

@fetzerch
Copy link

Even though the project is discontinued:
Starting with GitLab (Runner) 9.4 it is possible to override the entrypoint:

image:
    name: composer/composer:php5-alpine
    entrypoint: [""]

so that the image can be used with GitLab CI.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants