Skip to content

A test to see how Gitlab CI reacts to docker images with an entry point.

License

Notifications You must be signed in to change notification settings

waltertamboer/experiment-gitlab-ci-docker-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

experiment-gitlab-ci-docker-image

A test to see how Gitlab CI reacts to docker images with an entry point.

Problem

Gitlab CI starts overrides the entry point of a Docker image with the following script:

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

This makes it impossible to run a container with a set entry point such as ENTRYPOINT ["composer"].

Solution

The solution I found is based on https://github.com/composer/docker/blob/master/docker-entrypoint.sh.

The trick is to detect the incoming command and based on that command differentiate the processing of it.

Bonus

Use tini (https://github.com/krallin/tini) to initialize containers. Tini spawns a single child and waits for it to exit all the while reaping zombies and performing signal forwarding.

About

A test to see how Gitlab CI reacts to docker images with an entry point.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages