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

Path option not working as expected #90

Closed
Zethson opened this issue Aug 14, 2020 · 4 comments
Closed

Path option not working as expected #90

Zethson opened this issue Aug 14, 2020 · 4 comments
Milestone

Comments

@Zethson
Copy link

Zethson commented Aug 14, 2020

Hi,

      - name: debug
        run: |
          pwd

results in /home/runner/work/mlf-core/mlf-core

My Dockerfile is in /home/runner/work/mlf-core/exploding_springfield.
It's called Dockerfile.
I verified this in the Workflow!

 cd ../exploding_springfield
  pwd
  ls -la

-rw-r--r-- 1 runner docker  528 Aug 14 16:58 Dockerfile

Hence, I expect

- name: Build Docker container
        uses: docker/build-push-action@v1
        with:
          repository: mlfcore/exploding_springfield
          tags: 0.1.0-SNAPSHOT
          push: false
          path: ../exploding_springfield

or

      - name: Build Docker container
        uses: docker/build-push-action@v1
        with:
          dockerfile: ../exploding_springfield/Dockerfile
          repository: mlfcore/exploding_springfield
          tags: 0.1.0-SNAPSHOT
          push: false
          path: ../exploding_springfield

To find the Dockerfile.
However, even with the absolute path I always run into:
unable to prepare context: path "../exploding_springfield" not found
or
unable to prepare context: path "/home/runner/work/mlf-core/exploding_springfield" not found

What am I doing wrong?

Thank you very much!
Cheers

@lewislbr
Copy link

Adding to this, the path doesn't seem to be passed to dockerfile, having to rewrite the path (in this case folder1) like:

- name: Build and push Docker images
        uses: docker/build-push-action@master
        with:
          path: folder1
          dockerfile: folder1/Dockerfile
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
          repository: lewislbr/random

to make it work.

@crazy-max crazy-max added this to the v2 milestone Sep 2, 2020
@crazy-max
Copy link
Member

crazy-max commented Sep 2, 2020

@Zethson This will be solved through build-push-action v2 (#92) as it's written as a typescript-action to be as closed as possible of the GitHub Runner during its execution. You can already try it with:

@crazy-max
Copy link
Member

Version 2 has been merged to the main branch and is therefore available via uses: docker/build-push-action@v2 (mutable tag).

As a reminder, this new version changes drastically and works with 3 new actions (login, setup-buildx and setup-qemu) that we have created. Many usage examples have been added to handle most use cases.

And it should fix this current issue. Don't hesitate if you have any questions.

@Zethson
Copy link
Author

Zethson commented Sep 10, 2020 via email

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