-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update info about image_build workflow
- Loading branch information
1 parent
ef95211
commit db2e7cb
Showing
2 changed files
with
74 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,76 @@ | ||
# Container Image Build | ||
|
||
This workflow is used to build container | ||
images in a standardised way. | ||
This workflow is used to build container images | ||
in a standardised way. | ||
|
||
## Usage | ||
|
||
Basic usage of this action only requires the image_name input. | ||
|
||
```yaml | ||
test-img-build: | ||
uses: hotosm/gh-workflows/.github/workflows/[email protected] | ||
with: | ||
image_name: ghcr.io/${{ github.repository }} | ||
``` | ||
This will build an image for the repository. | ||
If multiple images are built in the same repository, it is | ||
possible to name the images under separate paths: | ||
```yaml | ||
ghcr.io/${{ github.repository }}/backend | ||
ghcr.io/${{ github.repository }}/frontend | ||
ghcr.io/${{ github.repository }}/some-other-service | ||
``` | ||
|
||
### Defaults | ||
|
||
- Build an image using the root directory, and file `Dockerfile`. | ||
- Automatically tag your image, depending on the branch or | ||
version number. | ||
- Inject the build-args: | ||
- APP_VERSION=${{ github.ref_name }} (the current branch or tag) | ||
- COMMIT_REF=${{ github.sha }} (the current commit) | ||
- Cache your image in the Github Container Registry for future builds. | ||
- Push your image to the registry for future use. | ||
|
||
## Vulnerability Scanning | ||
|
||
Two types of vulnerability scan are available. | ||
|
||
Both are enabled by default. | ||
|
||
### Static Code Analysis of Dockerfile | ||
|
||
Scanning of Dockerfiles for best practice security is done | ||
by [checkov](https://github.com/bridgecrewio/checkov-action). | ||
|
||
This can be disabled with the input parameter: | ||
`scan_dockerfile: false`. | ||
|
||
### CVE Scanning of Built Image | ||
|
||
The built image is scanned for CVEs present in the installed software | ||
by [Trivy](https://github.com/aquasecurity/trivy-action). | ||
|
||
This can be disabled with the input parameter: | ||
`scan_image: false`. | ||
|
||
## Multi Architecture Builds | ||
|
||
There is basic support for building multi-architecture images. | ||
|
||
By using the `multi_arch: true` option, builds can be made for | ||
AMD64 (default Linux/Windows), and ARM64 (newer MacOS M-chips). | ||
|
||
Please note, however, that using `multi_arch` may increase your build time | ||
by up to 3x. | ||
|
||
If speed is important, there is another workflow availble named | ||
**image_build_multi** that will build across multiple Github runners | ||
on native architecture, instead of via emulation. | ||
|
||
## Inputs | ||
|
||
|