Running jobs using a docker image fails
Feature disposition status (2022-12-22)
Closing this issue as outdated.
Overview
I am using a docker image to run my CI jobs. I set USER and WORKDIR in that image so the tests don't get executed as root. I just noticed that my builds start to fail because of permission errors. If I drop the USER and WORKDIR from the docker image the tests run. What has changed in the last couple of weeks? Is it something on my end that's wrong?
Here is the output from the failed execution:
gitlab-ci-multi-runner 0.7.2 (unknown)
Using Docker executor with image runner ...
Pulling docker image gitlab/gitlab-runner:cache ...
Pulling docker image gitlab/gitlab-runner:build ...
Pulling docker image runner:latest ...
Running on runner-738b0237-project-3-concurrent-1 via turing...
Cloning repository...
Cloning into '/builds/sim/postorius'...
Checking out 86ed717c as testing-ci...
Note: checking out '86ed717cc954ccdd6a67876212177af5d59ffd0d'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 86ed717... update
$ tox -e py27-django17
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/py/_error.py", line 64, in checked_call
return func(*args, **kwargs)
PermissionError: [Errno 13] Permission denied: '/builds/sim/postorius/.tox'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/sbin/tox", line 11, in <module>
sys.exit(cmdline())
File "/usr/lib/python3.4/site-packages/tox/session.py", line 39, in main
retcode = Session(config).runcommand()
File "/usr/lib/python3.4/site-packages/tox/session.py", line 325, in __init__
config.logdir.ensure(dir=1)
File "/usr/lib/python3.4/site-packages/py/_path/local.py", line 512, in ensure
return p._ensuredirs()
File "/usr/lib/python3.4/site-packages/py/_path/local.py", line 494, in _ensuredirs
parent._ensuredirs()
File "/usr/lib/python3.4/site-packages/py/_path/local.py", line 497, in _ensuredirs
self.mkdir()
File "/usr/lib/python3.4/site-packages/py/_path/local.py", line 447, in mkdir
py.error.checked_call(os.mkdir, getattr(p, "strpath", p))
File "/usr/lib/python3.4/site-packages/py/_error.py", line 84, in checked_call
raise cls("%s%r" % (func.__name__, args))
py.error.EACCES: [Permission denied]: mkdir('/builds/sim/postorius/.tox',)
ERROR: Build failed with: exit code 1
Edited by Darren Eastman