Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using checkout within a Docker container #841

Closed
hannesa2 opened this issue Jun 30, 2022 · 8 comments
Closed

Using checkout within a Docker container #841

hannesa2 opened this issue Jun 30, 2022 · 8 comments

Comments

@hannesa2
Copy link

Hi, I use actions/checkout with a Docker image

jobs:
  dockerRun:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        ubuntu: [ 'focal' ]
    container: hannesa2/abc-${{ matrix.ubuntu }}-4:pr-1
    steps:
      - name: investigate
        run: |
          pwd
          whoami
          ls -la
          id -u
      - name: Checkout
        uses: actions/checkout@v2

and run into
image

Does someone has an idea how to solve this user permission issue ?

@NickWalt01
Copy link

I added the line below after the checkout, in the picture in the Run drop down menu, should see a similar git command, suppose to be fixed in version 3
-run git config --global --add safe.directory ${GITHUB_WORKSPACE}

@hannesa2 hannesa2 changed the title Using checkout wihtin a Docker container Using checkout within a Docker container Jul 14, 2022
@hannesa2
Copy link
Author

hannesa2 commented Jul 14, 2022

I changed to

      - name: Checkout
          uses: actions/checkout@v3.0.2
      - name: Build with Docker
        run: |

image

(just for me to remember, it's branch DockerMissingPackageFix of a private repo)

I'm not sure, if I can do something better ?

@NickWalt01
Copy link

Sorry misread the issue in the photo, your issue states mkdir is denied, I thought it was this issue #766

@hannesa2
Copy link
Author

Sorry misread the issue in the photo, your issue states mkdir is denied, I thought it was this issue #766

Any Idea what's wrong here and how to fix ?

@hannesa2
Copy link
Author

To show issue, I transferred to public repo hannesa2/alexa-auto-sdk-public#3

@SeyoungLeeImprobable
Copy link

Try

container:
  image: <image>
  options: --user root

@yoramdelangen
Copy link

--user root

This worked for me, for now

hannesa2 added a commit to hannesa2/alexa-auto-sdk-public that referenced this issue Aug 29, 2022
@hannesa2
Copy link
Author

Thank you ! With your help it's works now.

hannesa2 added a commit to hannesa2/alexa-auto-sdk-public that referenced this issue Oct 5, 2022
hannesa2 added a commit to hannesa2/alexa-auto-sdk-public that referenced this issue Oct 5, 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

No branches or pull requests

4 participants