githubEdit

How to specify a custom Dockerfile location in GitHub Actions workflows

When using DuploCloud GitHub Actions to build Docker images, you can specify a custom location for your Dockerfile using the dockerfile input parameter in your workflow configuration. Configuring the workflow If your Dockerfile is not in the root directory of your repository, add the dockerfile parameter to the build-image action in your workflow file, specifying the relative path to your Dockerfile:

  • name: Build and Push Docker Image uses: duplocloud/actions/[email protected] id: build-and-push-backend with: repo: ${{ env.REPO }} registry: ${{ env.SERVICE_NAME }} platforms: linux/amd64 push: true dockerfile: docker/Dockerfile # Specify the path to your Dockerfile cache: false extra-tags: ${{ github.sha }} For example, if you moved your Dockerfile to a docker folder in your repository, you would set dockerfile: docker/Dockerfile . The path should be relative to the root of your repository. For more information about the build-image action and its parameters, see the official documentation .

Last updated

Was this helpful?