crops/poky-container

Does not work with gitlab-ci

Opened this issue · 5 comments

I think the entrypoint is causing issues with GitLab CI.

Maybe I'm doing something wrong, but the following should work, imho.

image: crops/poky

stages:
  - build

build_job:
  stage: build
  script:
    - echo 'Hello, world!'

The error I get is

usage: poky-entry.py [-h] [--workdir WORKDIR] [--id ID] [--cmd CMD]
poky-entry.py: error: unrecognized arguments: sh -c if [ -x /usr/local/bin/bash ]; then
	exec /usr/local/bin/bash 
elif [ -x /usr/bin/bash ]; then
	exec /usr/bin/bash 
elif [ -x /bin/bash ]; then
	exec /bin/bash 
elif [ -x /usr/local/bin/sh ]; then
	exec /usr/local/bin/sh 
elif [ -x /usr/bin/sh ]; then
	exec /usr/bin/sh 
elif [ -x /bin/sh ]; then
	exec /bin/sh 
else
	echo shell not found
	exit 1
fi


usage: poky-entry.py [-h] [--workdir WORKDIR] [--id ID] [--cmd CMD]
poky-entry.py: error: unrecognized arguments: sh -c if [ -x /usr/local/bin/bash ]; then
	exec /usr/local/bin/bash 
elif [ -x /usr/bin/bash ]; then
	exec /usr/bin/bash 
elif [ -x /bin/bash ]; then
	exec /bin/bash 
elif [ -x /usr/local/bin/sh ]; then
	exec /usr/local/bin/sh 
elif [ -x /usr/bin/sh ]; then
	exec /usr/bin/sh 
elif [ -x /bin/sh ]; then
	exec /bin/sh 
else
	echo shell not found
	exit 1
fi

I guess a workaround is just using "crops/yocto:ubuntu-14.04-base"..

I realize this is over a year old, and while it's not a solution, setting the entry point to nothing will let you get into a stage, at least:

image:
   name: crops/poky:ubuntu-14.04
   entrypoint: [ "" ]

I'm trying to set this up for a layer and the ugly thing is your build directory assigned by the runner is within your layer.

BTW @cfriedtpv, I've traced this down further to two things. First, the actual main issue is that if the image's entrypoint doesn't support having scripts passed as CMD, the image is incompatible with gitlab-runner (reference).

Second, the issue in this thread, is that the poky-entry.py's use of parse_args vs. parse_known_args or allowing for multiple trailing args -- that's what is throwing the error when gitlab-runner passes the script as CMD.

PR #34 hints at this particular problem, #37 solves it.

Oh wow - I barely even remember reporting this issue. I'm trying to figure out what crops is - is it the dockerized Yocto image?

@cfriedt,

These docker images in this repo are for building images using Yocto/OpenEmbedded. They were originally created and used on Linux, as a relatively easy way to do containerized builds.

"crops" stands for cross platform and was a github group that we were already using, so rather than create another new group, these containers went there. There were also some other ones that are now dead, and unfortunately if you look at the crops group there is a lot of clutter.

There is some cross platform support for building using these containers, considering that docker will run on other platforms other than Linux.

Should be fixed by #37.