This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up development environment with Skaffold (#393)
* add submodule Signed-off-by: knqyf263 <[email protected]> * remove vagrant files Signed-off-by: knqyf263 <[email protected]> * add skaffold Signed-off-by: knqyf263 <[email protected]> * update docs Signed-off-by: knqyf263 <[email protected]> * docs: mention Podman Signed-off-by: knqyf263 <[email protected]> --------- Signed-off-by: knqyf263 <[email protected]>
- Loading branch information
Showing
11 changed files
with
102 additions
and
226 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,3 @@ | ||
[submodule "harbor-helm"] | ||
path = harbor-helm | ||
url = https://github.com/goharbor/harbor-helm.git |
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,33 @@ | ||
# That's the only place where you're supposed to specify version of Trivy. | ||
ARG TRIVY_VERSION=0.46.0 | ||
ARG SKAFFOLD_GO_GCFLAGS | ||
|
||
FROM golang:1.21-alpine AS builder | ||
|
||
WORKDIR /go/src/github.com/aquasecurity/harbor-scanner-trivy | ||
|
||
# Download Go dependencies first | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
# Copy the entire project and build it. | ||
COPY cmd/ ./cmd | ||
COPY pkg/ ./pkg | ||
RUN CGO_ENABLED=0 go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -o scanner-trivy cmd/scanner-trivy/main.go | ||
|
||
FROM aquasec/trivy:${TRIVY_VERSION} | ||
|
||
ENV GOTRACEBACK=all | ||
|
||
# An ARG declared before a FROM is outside of a build stage, so it can't be used in any | ||
# instruction after a FROM. To use the default value of an ARG declared before the first | ||
# FROM use an ARG instruction without a value inside of a build stage. | ||
ARG TRIVY_VERSION | ||
|
||
RUN adduser -u 10000 -D -g '' scanner scanner | ||
|
||
COPY --from=builder /go/src/github.com/aquasecurity/harbor-scanner-trivy/scanner-trivy /home/scanner/bin/scanner-trivy | ||
|
||
ENV TRIVY_VERSION=${TRIVY_VERSION} | ||
|
||
ENTRYPOINT ["/home/scanner/bin/scanner-trivy"] |
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
Submodule harbor-helm
added at
fd3a4b
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,22 @@ | ||
apiVersion: skaffold/v4beta7 | ||
kind: Config | ||
metadata: | ||
name: harbor-scanner-trivy | ||
build: | ||
local: | ||
push: false # Use kind, minikube, Docker Desktop, Rancher Desktop, etc. | ||
useDockerCLI: true | ||
artifacts: | ||
- image: aquasecurity/harbor-scanner-trivy | ||
docker: | ||
dockerfile: Dockerfile.dev | ||
deploy: | ||
helm: | ||
releases: | ||
- name: my-harbor | ||
chartPath: ./harbor-helm # remoteChart doesn't work for some reason | ||
valuesFiles: | ||
- ./harbor-helm/values.yaml | ||
setValueTemplates: | ||
trivy.image.repository: "{{.IMAGE_REPO_aquasecurity_harbor_scanner_trivy}}" | ||
trivy.image.tag: "{{.IMAGE_TAG_aquasecurity_harbor_scanner_trivy}}" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.