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

Question about context path #45

Open
Kakcalu13 opened this issue Dec 6, 2023 · 5 comments
Open

Question about context path #45

Kakcalu13 opened this issue Dec 6, 2023 · 5 comments

Comments

@Kakcalu13
Copy link

The snippet below:

      - name: Push to GCR GitHub Action
        uses: RafikFarhad/[email protected]
        with:
          gcloud_service_key: ${{ secrets.GCR_SERVICE }}
          project_id: feagi-poc
          image_name: test
          image_tag: latest
          dockerfile: ./tmp/playground/Dockerfile
          context: /

The dockerfile I have is in /tmp/playground

how come I couldn't use like this:

          dockerfile: .Dockerfile
          context: ./tmp/playground

or

          dockerfile: ./tmp/playground/Dockerfile
          context: ./tmp/playground

None of them worked. I'm unable to access to see where is the default path it is in. How do I direct context to get the /tmp/playground?

@RafikFarhad
Copy link
Owner

This should work except the . in front of Dockerfile

dockerfile: Dockerfile
context: ./tmp/playground

Build process will set the context first and will look for the Dockerfile

@Kakcalu13
Copy link
Author

Thanks @RafikFarhad!

Testing it now

@Kakcalu13
Copy link
Author

Unfortunately, that did not work. Sounds like it couldn't run the dockerfile anywhere, it has to be inside the current directory. See here:

I added one job before push to gcr.

image

Then the next job (which is the same one as above plus your change/suggestion:
image

See the snippet of yml:

      - name: debugging playground
        working-directory: /tmp/playground
        run: |
          pwd
          echo "ls playground"
          ls
      - name: Push to GCR GitHub Action
        uses: RafikFarhad/[email protected]
        with:
          gcloud_service_key: ${{ secrets.GCR_SERVICE }}
          project_id: feagi-poc
          image_name: feagi-dev/playground
          image_tag: ${{ github.run_number }}, latest
          dockerfile: Dockerfile
          context: ./tmp/playground

Honestly, I don't see anything wrong with your suggestion. If you have more ideas, I'd love to hear them since I've hit the block now :(

@tntchn
Copy link
Contributor

tntchn commented Dec 27, 2023

See the snippet of yml:

      - name: debugging playground
        working-directory: /tmp/playground
        run: |
          pwd
          echo "ls playground"
          ls
      - name: Push to GCR GitHub Action
        uses: RafikFarhad/[email protected]
        with:
          gcloud_service_key: ${{ secrets.GCR_SERVICE }}
          project_id: feagi-poc
          image_name: feagi-dev/playground
          image_tag: ${{ github.run_number }}, latest
          dockerfile: Dockerfile
          context: ./tmp/playground

thought your working directory in previous step is actually /tmp/playground, you should use

             context: /tmp/playground

instead of ./tmp/playground (which is /home/runner/work/{repo_owner}/{repo}/tmp/playground )

I guess the content of /tmp/playground were created by a previous step which was not included in your repo, so docker could not found the context with the wrong PATH

@Kakcalu13
Copy link
Author

oh oops, sorry for the delay! I came back to this repo for an arg to build usnig arm64 and I saw a new reply. I will try it out! Thank you for ur time!

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

3 participants