create autoscale-go image (#5554)

This commit is contained in:
Dave Protasowski 2023-05-09 12:03:00 -04:00 committed by GitHub
parent a763a6f294
commit 098a9da831
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 2 deletions

View File

@ -39,3 +39,11 @@ jobs:
platforms: linux/amd64,linux/arm64
context: ./code-samples/serving/hello-world/helloworld-go
tags: ghcr.io/knative/helloworld-go:latest
- name: Build autoscale-go image
uses: docker/build-push-action@v4
with:
push: false
platforms: linux/amd64,linux/arm64
context: ./docs/serving/autoscaling/autoscale-go
tags: ghcr.io/knative/autoscale-go:latest

View File

@ -14,10 +14,14 @@
FROM golang AS builder
ARG TARGETOS
ARG TARGETARCH
WORKDIR /go/src/app
COPY . /go/src/app
RUN CGO_ENABLED=0 go build -o /bin/autoscale-go .
RUN CGO_ENABLED=0 go build -o /bin/load-generator ./test
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /bin/autoscale-go .
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /bin/load-generator ./test
FROM gcr.io/distroless/base
EXPOSE 8080

View File

@ -0,0 +1,3 @@
module autoscale-go
go 1.20