Skip to content

Commit

Permalink
Make the Docker context and Dockerfile path configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
ximon18 committed Nov 2, 2022
1 parent eeafc87 commit 5abdd29
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/pkg-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ on:
required: false
type: string
default: false
docker_context_path:
description: "Relative path to use as the Docker build context. Defaults to the root of the git clone, i.e. '.'."
required: false
type: string
default: '.'
docker_file_path:
description: "Relative path to the Dockerfile to build. Defaults to the Dockerfile in the root of the git clone, i.e. './Dockerfile'."
required: false
type: string
default: './Dockerfile'
docker_build_rules:
description: "A GitHub Actions matrix in JSON format with platform, shortname, crosstarget (required if mode is copy), mode (optional: build (default) or copy) and cargo_args (optional) fields."
required: false
Expand Down Expand Up @@ -1444,7 +1454,8 @@ jobs:
- name: Build Docker image ${{ steps.gen.outputs.image_name }}
uses: docker/build-push-action@v3
with:
context: .
context: ${{ inputs.docker_context_path }}
file: ${{ inputs.docker_file_path }}
platforms: ${{ matrix.platform }}
tags: ${{ steps.gen.outputs.image_name }}
build-args: |
Expand Down Expand Up @@ -1481,7 +1492,8 @@ jobs:
if: ${{ needs.prepare.outputs.has_docker_secrets && contains(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
uses: docker/build-push-action@v3
with:
context: .
context: ${{ inputs.docker_context_path }}
file: ${{ inputs.docker_file_path }}
platforms: ${{ matrix.platform }}
tags: ${{ steps.gen.outputs.image_name }}
build-args: |
Expand Down

0 comments on commit 5abdd29

Please sign in to comment.