A GitHub Action for invoking docker buildx build
.
The GitHub Action performs:
- docker/setup-qemu-action@v3
- docker/setup-buildx-action@v3
- docker/login-action@v3
Logs into a Docker registry (docker.io
being the default) - Performs
docker buildx build
...
-
An example
.github/workflows/docker-build-container.yaml
file which verifies that the Docker image builds successfully:name: docker-build-container.yaml on: [push] jobs: docker-build-container: runs-on: ubuntu-latest steps: - name: Build docker image uses: Senzing/github-action-docker-buildx-build@latest with: image-repository: senzing/test-ground image-tag: ${{ github.ref_name }} password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} username: ${{ secrets.DOCKERHUB_USERNAME }}
-
An example
.github/workflows/docker-push-container-to-dockerhub.yaml
file which builds Docker images and pushes them to DockerHub:name: docker-push-container-to-dockerhub.yaml on: push: tags: - "[0-9]+.[0-9]+.[0-9]+" jobs: docker-push-containers-to-dockerhub: runs-on: ubuntu-latest steps: - name: Build docker image and push to DockerHub uses: Senzing/github-action-docker-buildx-build@latest with: build-options: "--push" image-repository: senzing/test-ground image-tag: ${{ github.ref_name }} password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} username: ${{ secrets.DOCKERHUB_USERNAME }}
Notice the addition of the
--push
build option. Build options are inserted into thedocker buildx build
command.
See also inputs:
section of action.yaml
Command-line arguments passed directly to docker buildx build
- Optional parameter
- Default: "" (no build options)
The docker
command's build context.
See Description.
- Optional parameter
- Default: "."
The identifier of the Docker image.
- Required parameter
- Example:
senzing/senzingapi-runtime
The tag appended to the Docker image identifier.
Example: the 1.2.3
in senzing/senzingapi-runtime:1.2.3
- Optional parameter
- Default: "latest"
The access token or password for the user on the Docker registry server.
It is recommended to use an access token for login.
Refer to the respective registry provider documentation for additional login details.
- Required parameter
The comma-separated list of platforms to build on.
To find candidates, run docker buildx ls
- Optional parameter
- Default: "linux/amd64"
The Docker registry server.
- Optional parameter
- Default:
docker.io
The username on the Docker registry server.
- Required parameter