docker / setup-buildx-action

GitHub Action to set up Docker Buildx
https://github.com/marketplace/actions/docker-setup-buildx
Apache License 2.0
905 stars 142 forks source link

How to set working directory? #285

Closed hinchley2018 closed 7 months ago

hinchley2018 commented 7 months ago

Description

Not a bug more of a confusion / missing documentation This action currently assumes the Dockerfile is in the current directory, I have a project that is a monorepo, with a frontend folder that has my docker file in it

I want to pass this docker file to the task, or set current directory?? Read the docs and other issues didn't see anything useful for what i was trying to do Things I've tried

crazy-max commented 7 months ago

This action currently assumes the Dockerfile is in the current directory,

setup-buildx-action is only used to manage buildx and builders and doesn't run any build. I think you're looking for https://github.com/docker/build-push-action/.

hinchley2018 commented 7 months ago

I never said I was trying to run a build, from what I understood in the documentation this task seems to export caches https://github.com/docker/setup-buildx-action#about

This task was auto-generated from microsoft azure when setting up a deploy. I already have my build-push-action working with the path I want to use

- name: Build and push container image to registry
      uses: docker/build-push-action@v3
      with:
        push: true
        tags: ${{ secrets.ACR_REGISTRY }}/frontend:${{ github.sha }}
         context: "{{defaultContext}}:frontend"

I'm a bit confused why you closed this issue @crazy-max because my question was not answered...

hinchley2018 commented 7 months ago

@crazy-max is it preferred to cache in the registry instead of using buildx? https://docs.docker.com/build/ci/github-actions/cache/

Also if I don't need this task perhaps I should remove this task, since the build itself is already working I'm trying to optimize