checkout icon indicating copy to clipboard operation
checkout copied to clipboard

Using checkout within a Docker container

Open hannesa2 opened this issue 3 years ago • 5 comments

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 ?

hannesa2 avatar Jun 30 '22 15:06 hannesa2

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}

NickWalt01 avatar Jul 14 '22 15:07 NickWalt01

I changed to

      - name: Checkout
          uses: actions/[email protected]
      - 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 ?

hannesa2 avatar Jul 14 '22 18:07 hannesa2

Sorry misread the issue in the photo, your issue states mkdir is denied, I thought it was this issue https://github.com/actions/checkout/issues/766

NickWalt01 avatar Jul 15 '22 08:07 NickWalt01

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 avatar Jul 15 '22 08:07 hannesa2

To show issue, I transferred to public repo https://github.com/hannesa2/alexa-auto-sdk-public/pull/3

hannesa2 avatar Jul 15 '22 08:07 hannesa2

Try

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

SeyoungLeeImprobable avatar Aug 19 '22 10:08 SeyoungLeeImprobable

--user root

This worked for me, for now

yoramdelangen avatar Aug 29 '22 13:08 yoramdelangen

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

hannesa2 avatar Aug 29 '22 18:08 hannesa2