-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add base TF config and Dockerfile (#11)
* add base TF config and Dockerfile * add Dockerfile and goreleaser config
- Loading branch information
Mike Vanbuskirk
committed
Apr 10, 2023
1 parent
4a1e9a3
commit 43018d8
Showing
6 changed files
with
96 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
builds: | ||
- binary: gcp-auditor | ||
ldflags: | ||
- -X 'github.com/trufflesecurity/gcp-auditor/pkg/version.BuildVersion={{ .Version }}' | ||
env: [CGO_ENABLED=0] | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
dockers: | ||
- image_templates: ["trufflesecurity/{{ .ProjectName }}:{{ .Version }}-amd64"] | ||
dockerfile: Dockerfile.goreleaser | ||
use: buildx | ||
build_flag_templates: | ||
- --platform=linux/amd64 | ||
- --label=org.opencontainers.image.title={{ .ProjectName }} | ||
- --label=org.opencontainers.image.description={{ .ProjectName }} | ||
- --label=org.opencontainers.image.url=https://github.com/trufflesecurity/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.source=https://github.com/trufflesecurity/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.version={{ .Version }} | ||
- --label=org.opencontainers.image.revision={{ .FullCommit }} | ||
- --label=org.opencontainers.image.licenses=AGPL-3.0 | ||
- image_templates: ["trufflesecurity/{{ .ProjectName }}:{{ .Version }}-arm64v8"] | ||
goarch: arm64 | ||
dockerfile: Dockerfile.goreleaser | ||
use: buildx | ||
build_flag_templates: | ||
- --platform=linux/arm64/v8 | ||
- --label=org.opencontainers.image.title={{ .ProjectName }} | ||
- --label=org.opencontainers.image.description={{ .ProjectName }} | ||
- --label=org.opencontainers.image.url=https://github.com/trufflesecurity/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.source=https://github.com/trufflesecurity/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.version={{ .Version }} | ||
- --label=org.opencontainers.image.revision={{ .FullCommit }} | ||
- --label=org.opencontainers.image.licenses=AGPL-3.0 | ||
- image_templates: ["ghcr.io/trufflesecurity/{{ .ProjectName }}:{{ .Version }}-amd64"] | ||
dockerfile: Dockerfile.goreleaser | ||
use: buildx | ||
build_flag_templates: | ||
- --platform=linux/amd64 | ||
- --label=org.opencontainers.image.title={{ .ProjectName }} | ||
- --label=org.opencontainers.image.description={{ .ProjectName }} | ||
- --label=org.opencontainers.image.url=https://github.com/trufflesecurity/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.source=https://github.com/trufflesecurity/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.version={{ .Version }} | ||
- --label=org.opencontainers.image.revision={{ .FullCommit }} | ||
- --label=org.opencontainers.image.licenses=AGPL-3.0 | ||
- image_templates: ["ghcr.io/trufflesecurity/{{ .ProjectName }}:{{ .Version }}-arm64v8"] | ||
goarch: arm64 | ||
dockerfile: Dockerfile.goreleaser | ||
use: buildx | ||
build_flag_templates: | ||
- --platform=linux/arm64/v8 | ||
- --label=org.opencontainers.image.title={{ .ProjectName }} | ||
- --label=org.opencontainers.image.description={{ .ProjectName }} | ||
- --label=org.opencontainers.image.url=https://github.com/trufflesecurity/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.source=https://github.com/trufflesecurity/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.version={{ .Version }} | ||
- --label=org.opencontainers.image.revision={{ .FullCommit }} | ||
- --label=org.opencontainers.image.licenses=AGPL-3.0 | ||
docker_manifests: | ||
- name_template: ghcr.io/trufflesecurity/{{ .ProjectName }}:{{ .Version }} | ||
image_templates: | ||
- ghcr.io/trufflesecurity/{{ .ProjectName }}:{{ .Version }}-amd64 | ||
- ghcr.io/trufflesecurity/{{ .ProjectName }}:{{ .Version }}-arm64v8 | ||
- name_template: ghcr.io/trufflesecurity/{{ .ProjectName }}:latest | ||
image_templates: | ||
- ghcr.io/trufflesecurity/{{ .ProjectName }}:{{ .Version }}-amd64 | ||
- ghcr.io/trufflesecurity/{{ .ProjectName }}:{{ .Version }}-arm64v8 |
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,16 @@ | ||
FROM --platform=${BUILDPLATFORM} golang:bullseye as builder | ||
|
||
WORKDIR /build | ||
COPY . . | ||
ENV CGO_ENABLED=0 | ||
ARG TARGETOS TARGETARCH | ||
RUN --mount=type=cache,target=/go/pkg/mod \ | ||
--mount=type=cache,target=/root/.cache/go-build \ | ||
GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o gcp-auditor . | ||
|
||
FROM alpine:3.17 | ||
RUN apk add --no-cache git ca-certificates \ | ||
&& rm -rf /var/cache/apk/* && \ | ||
update-ca-certificates | ||
COPY --from=builder /build/gcp-auditor /usr/bin/gcp-auditor | ||
ENTRYPOINT ["/usr/bin/gcp-auditor"] |
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,10 @@ | ||
module "auditor" { | ||
source = "" | ||
|
||
name = var.name | ||
project_id = local.project | ||
logging_sink_filter = var.filter | ||
organization_id = var.organization_id | ||
region = var.region | ||
docker_image = var.image | ||
} |
Empty file.
Empty file.