Skip to content

Commit 5ed4a78

Browse files
authored
Merge pull request #35 from iastewar/distroless-image
Changed base image to gcr.io/distroless/static:nonroot
2 parents 47fb3be + ecab424 commit 5ed4a78

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# base image is the same as ko's default
16-
FROM cgr.dev/chainguard/static:latest
15+
FROM gcr.io/distroless/static:nonroot
1716
COPY gcp-auth-webhook /gcp-auth-webhook
1817
ENTRYPOINT ["/gcp-auth-webhook"]

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ GOOS?=$(shell go env GOOS)
44
GOARCH?=$(shell go env GOARCH)
55
ARCH=$(if $(findstring amd64, $(GOARCH)),x86_64,$(GOARCH))
66
KO_VERSION=0.12.0
7+
BASE_IMAGE?=gcr.io/distroless/static:nonroot
78

89
build: ## Build the gcp-auth-webhook binary
910
CGO_ENABLED=0 GOOS=linux go build -ldflags="-X 'main.Version=$(VERSION)'" -o out/gcp-auth-webhook server.go
@@ -12,7 +13,7 @@ build: ## Build the gcp-auth-webhook binary
1213
image: ## Create and push multiarch manifest and images
1314
@read -p "This will build and push $(REGISTRY)/gcp-auth-webhook:$(VERSION). Do you want to proceed? (Y/N): " confirm && echo $$confirm | grep -iq "^[yY]" || exit 1;
1415
curl -L https://github.com/google/ko/releases/download/v$(KO_VERSION)/ko_$(KO_VERSION)_$(GOOS)_$(ARCH).tar.gz | tar xzf - ko && chmod +x ./ko
15-
GOFLAGS="-ldflags=-X=main.Version=$(VERSION)" KO_DOCKER_REPO=$(REGISTRY) ./ko publish -B . --platform all -t $(VERSION)
16+
GOFLAGS="-ldflags=-X=main.Version=$(VERSION)" KO_DOCKER_REPO=$(REGISTRY) KO_DEFAULTBASEIMAGE=$(BASE_IMAGE) ./ko publish -B . --platform all -t $(VERSION)
1617
rm ./ko
1718

1819
.PHONY: local-image

0 commit comments

Comments
 (0)