Skip to content

Conversation

mxschmitt
Copy link
Member

@mxschmitt mxschmitt commented Apr 27, 2022

/root/playwright inside the Docker container is owned by 1001:121 (runner:docker) which is != root:root thats why we get the following error message:

root@4d691546890c:~/playwright# git log
fatal: unsafe repository ('/root/playwright' is owned by someone else)
To add an exception for this directory, call:

        git config --global --add safe.directory /root/playwright

The folder was created by the checkout action from GitHub Actions, which uses the GitHub Action default user for that.

Relates to git/git@8959555

cc/FYI @dscho

@mxschmitt mxschmitt force-pushed the bugfix-docker-tests branch 2 times, most recently from 9fa1d1f to 825ee5c Compare April 27, 2022 11:09
@mxschmitt mxschmitt force-pushed the bugfix-docker-tests branch from 825ee5c to 004cc2f Compare April 27, 2022 11:23
@mxschmitt mxschmitt changed the title chore: try to fix Docker tests chore: fix Docker tests Apr 27, 2022
@mxschmitt mxschmitt changed the title chore: fix Docker tests test: fix Docker tests Apr 27, 2022
@@ -36,6 +36,8 @@ jobs:
- name: Test
run: |
CONTAINER_ID="$(docker run --rm -v $(pwd):/root/playwright --name playwright-docker-test --workdir /root/playwright/ -d -t playwright-python:localbuild-focal /bin/bash)"
# Fix permissions for Git inside the container
docker exec "${CONTAINER_ID}" chown -R root:root /root/playwright
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have the same issue in production docker images?

Copy link
Member Author

@mxschmitt mxschmitt Apr 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, this is only because we mount a Git repository (outside) which was created by the GitHub Actions user inside the container. And Python (setuptools) internally does use Git to determine which version tag it uses internally, this failed before. The Git error message above was added very recently to Git as well, thats why it was working a few weeks ago and now not anymore.

@mxschmitt mxschmitt merged commit d795da6 into microsoft:main Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants