Closed joshjohnson closed 3 years ago
Proposing the following :
This should gracefully handle the jenkins case. There is oddity in using the /root dir as the user's home, but if it works it will avoid a breaking change. It will break if the entrypoint is overridden; it seems fair to assume that it is the caller's responsibility in that case.
@lukaszczerpak @joshjohnson any thoughts about this approach?
I am not sure what would be the best approach here, but am gonna experiment with it next week.
Root cause of the ugly error is that CLI wants to add missing cache-dir
option to the config file but has no permissions to do it. As a result it throws an exception. When the option is present, then akamai help
works fine even when executed as non-root user. This is currently fixed in dev (https://github.com/akamai/akamai-docker/compare/fix/missing-cachedir-in-config) and updated images should be available very soon.
Long term, we should better support non-root scenario as the above might not be enough. Here is what I think we need to properly handle such scenario:
/workdir
and use it as WORKDIR (base image)/cli/.akamai-cli/cache
(cli image)
When running in a Jenkins Pipeline, the akamai/shell image results in a segfault error. I was able to replicate for a simple command of
akamai help
.Jenkins provides a
-u
option of a user that does not exist when executing the docker command.I believe that the issue is related to https://issues.jenkins-ci.org/browse/JENKINS-38438
A minimal Jenkins pipeline file to replicate the issue is
The behavior can be replicated outside of Jenkins with the command: