Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: opt-in sbom and provenance #11

Merged
merged 3 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:

env:
DOCKERHUB_SLUG: docker/buildkit-syft-scanner
BUILDX_VERSION: v0.10.0-rc2
BUILDKIT_IMAGE: moby/buildkit:v0.11.0-rc3

jobs:
build:
Expand Down Expand Up @@ -48,6 +50,10 @@ jobs:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: ${{ env.BUILDX_VERSION }}
driver-opts: image=${{ env.BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
Expand All @@ -64,3 +70,8 @@ jobs:
${{ steps.meta.outputs.bake-file }}
targets: image
push: ${{ github.event_name != 'pull_request' }}
set: |
*.cache-from=type=gha,scope=image
*.cache-to=type=gha,scope=image,mode=max
*.attest=type=sbom
*.attest=type=provenance,mode=max,builder-id=https://github.com/${{ env.GITHUB_REPOSITORY }}/actions/runs/${{ env.GITHUB_RUN_ID }}
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#syntax=docker/dockerfile:1
# syntax=docker/dockerfile-upstream:master

ARG GO_VERSION="1.19"
ARG ALPINE_VERSION="3.16"
ARG ALPINE_VERSION="3.17"
ARG XX_VERSION="1.1.2"

FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx

FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS base
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS base
COPY --from=xx / /
ENV CGO_ENABLED=0
RUN apk add --no-cache file git
Expand Down