Skip to content

Commit

Permalink
Enable CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
errordeveloper committed Aug 2, 2023
1 parent 728796b commit e778609
Show file tree
Hide file tree
Showing 5,124 changed files with 1,698,816 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI
on:
pull_request:
types: [opened, reopened]
push:
branches: ["**"]

jobs:
image:
name: Build the image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: docker/setup-qemu-action@v2
- uses: docker://ghcr.io/errordeveloper/imagine:2ac274f.8fed464-dev@sha256:fb1b83b0b83701990dbf9449058c7ad611e70ec15cb42bb394260a71daeb391f
env:
ANY_REGISTRY_DISABLE: true
DOCKER_HUB_PUBLIC_ACCESS_ONLY: true
GHCR_USERNAME: $GITHUB_ACTOR
GHCR_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
with:
entrypoint: imagine
args: build --platform linux/amd64,linux/arm64 --config build.yaml --upstream-branch origin/main --registry ghcr.io/docker --push
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ARG GOLANG_IMAGE=docker.io/library/golang:1.20@sha256:bc5f0b5e43282627279fe5262ae275fecb3d2eae3b33977a7fd200c7a760d6f1

FROM --platform=${BUILDPLATFORM} ${GOLANG_IMAGE} as builder-base

WORKDIR /src
ENV GOPRIVATE=github.com/docker

RUN --mount=type=bind,target=/src --mount=target=/root/.cache,type=cache --mount=target=/go/pkg/mod,type=cache \
go vet ./...

RUN --mount=type=bind,target=/src --mount=target=/root/.cache,type=cache --mount=target=/go/pkg/mod,type=cache \
go test ./...

FROM builder-base as builder-arch

ARG TARGETOS
ARG TARGETARCH

RUN mkdir -p /out/${TARGETOS}/${TARGETARCH}/usr/bin

RUN --mount=type=bind,target=/src --mount=target=/root/.cache,type=cache --mount=target=/go/pkg/mod,type=cache \
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -ldflags '-s -w' -o /out/${TARGETOS}/${TARGETARCH}/usr/bin/tape ./tape

FROM scratch

ARG TARGETOS
ARG TARGETARCH

# TODO: include CA certificates
WORKDIR /var/lib/buildkit-operator
COPY --from=builder-arch /out/${TARGETOS}/${TARGETARCH}/usr/bin /usr/bin

USER 65534:65534
ENTRYPOINT ["/usr/bin/tape"]
11 changes: 11 additions & 0 deletions Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*

!go.mod
!go.sum

!vendor/

!tape/

!manifest/
!oci/
6 changes: 6 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: ImagineBuildConfig
apiVersion: v1alpha1

spec:
name: labs-brow-tape
dir: ./
Loading

0 comments on commit e778609

Please sign in to comment.