cytopia/docker-ansible

Specify USER not working with gitlab CI docker executor

ebuildy opened this issue · 1 comments

When using this image , with gitlab CI docker executor, I got the error:

[INFO] Running container with user 'ansible'
[INFO] Adjusting local user with uid:999 and gid:1000
[INFO] Adjusting ownership on directory: ~/.gnupg/
[INFO] Adjusting ownership on directory: ~/.ssh/
[INFO] ansible> 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 
elif [ -x /busybox/sh ]; then
	exec /busybox/sh 
else
	echo shell not found
	exit 1
fi
bash: -c: line 1: syntax error near unexpected token `then'
bash: -c: line 1: `sh -c if [ -x /usr/local/bin/bash ]; then'

This is because the bootstrap gitlabCI script: https://gitlab.com/gitlab-org/gitlab-runner/-/blob/main/shells/bash.go#L18-37

Not sure about this, but /bin/sh is installed