Skip to content

Commit

Permalink
Merge branch 'main' into add-makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
shukra-in-spirit authored Jun 29, 2022
2 parents 3107e9f + 319e7b0 commit 2fa5291
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/go-ossf-slsa3-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow lets you compile your Go project using a SLSA3 compliant builder.
# This workflow will generate a so-called "provenance" file describing the steps
# that were performed to generate the final binary.
# The project is an initiative of the OpenSSF (openssf.org) and is developed at
# https://github.com/slsa-framework/slsa-github-generator.
# The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier.
# For more information about SLSA and how it improves the supply-chain, visit slsa.dev.

name: SLSA Go releaser
on:
workflow_dispatch:
release:
types: [created]

permissions: read-all

jobs:
build:
permissions:
id-token: write # To sign.
contents: write # To upload release assets.
actions: read # To read workflow path.
# If you need more configuration options, such as ldflag examples,
# visit https://github.com/slsa-framework/slsa-github-generator#golang-projects.
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
# By default, the config file is .slsa-goreleaser.yml in the root directory.
# The format of the config file is described in
# https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/go/README.md#configuration-file.
go-version: 1.17
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM golang:1.18 as build
WORKDIR /go/src/app
COPY . .
RUN mkdir -p /go/bin && go build -ldflags="-w -s" -o /go/bin/app ./...

# Using a distroless image from https://github.com/GoogleContainerTools/distroless
# Image sourced from https://console.cloud.google.com/gcr/images/distroless/global/static
FROM gcr.io/distroless/static:nonroot
COPY --from=build /go/bin/app /
# numeric version of user nonroot:nonroot provided in image
USER 65532:65532
CMD ["/app"]

0 comments on commit 2fa5291

Please sign in to comment.