HOME is overridden for containers
See original GitHub issueDescribe the bug
If passing the HOME
environment variable to a container configuration,
it will get ignored and set to /github/home
anyway as per
https://github.com/actions/runner/blob/4e85b8f3b7493aa1adf9dd0a574a9fa2bf1add71/src/Runner.Worker/ContainerOperationProvider.cs#L258
To Reproduce
A workflow with
jobs:
main:
runs-on: ubuntu-latest
container:
image: 'rokmoln/sf-ubuntu-bionic-common:0.2.80'
options: '--user sf:sf' # this user's home is /home/sf
env:
HOME: /home/sf # tried to change HOME from /github/home to /home/sf. doesn't work
steps:
- shell: bash
run: |
echo $HOME
will echo /github/home
instead of /home/sf
.
Expected behavior
Expected HOME to be left as is, as sf
user’s HOME,
or at the very least to be allowed to enforce it via the env
dictionary.
Runner Version and Platform
2.274.2
What’s not working?
N/A
Job Log Output
N/A
Runner and Worker’s Diagnostic Logs
N/A
Issue Analytics
- State:
- Created 3 years ago
- Reactions:49
- Comments:20 (3 by maintainers)
Top Results From Across the Web
GitHub Actions ignores/overrides Docker container's ...
Looking at the log, it appears that the container was created with --entrypoint "tail" , causing the run.sh script to be ignored. I...
Read more >Overriding the user Docker containers run as.
The lack of a home directory means that even if we update the IPython Docker image to run as the 'www-data' user, it...
Read more >Define Environment Variables for a Container
This page shows how to define environment variables for a container in a Kubernetes ... override any environment variables specified in the container...
Read more >infra docker-container --override volumes not a valid list
DockerContainer.volumes is a list but prefect deployment build --override volumes=/host/path:/container/path puts a string in the YAML.
Read more >docker run
The docker run command runs a command in a new container, pulling the image if needed ... --detach-keys, Override the key sequence for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Hoxu you touched on the most important bit:
If I may suggest a possible solution:
HOME
only if not already setGITHUB_HOME
orGITHUB_RUNNER_HOME
in order to allow devs not to hardcode/github/home
in case there’s a use-case to access the runner’s home from inside a container.