-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from interlynk-io/fix/dockerize
[ISSUE-19] Dockerize sbomasm
- Loading branch information
Showing
3 changed files
with
56 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: GHCR Publishing | ||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Get Tag | ||
id: get_tag | ||
run: echo "tag=$(git describe --tags HEAD)" > $GITHUB_ENV | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: GHCR login | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: '${{ github.actor }}' | ||
password: '${{ secrets.GITHUB_TOKEN }}' | ||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ghcr.io/${{ github.repository }}:${{ env.tag }} |
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 |
---|---|---|
|
@@ -15,9 +15,6 @@ | |
vendor/ | ||
build/ | ||
|
||
version.txt | ||
*.yaml | ||
*.yml | ||
*.sbom | ||
version.txt | ||
|
||
dist/ |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM golang:1.20-alpine AS builder | ||
LABEL org.opencontainers.image.source="https://github.com/interlynk-io/sbomasm" | ||
|
||
RUN apk add --no-cache make | ||
WORKDIR /app | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
COPY . . | ||
RUN make ; make build | ||
|
||
FROM scratch | ||
LABEL org.opencontainers.image.source="https://github.com/interlynk-io/sbomasm" | ||
LABEL org.opencontainers.image.description="SBOM Assembler - Assembler for SBOMs" | ||
LABEL org.opencontainers.image.licenses=Apache-2.0 | ||
|
||
COPY --from=builder /app/build/sbomasm /app/sbomasm | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
|
||
ENTRYPOINT [ "/app/sbomasm"] |