Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create autoscale-go image #5554

Merged
merged 1 commit into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 6 additions & 2 deletions docs/serving/autoscaling/autoscale-go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions docs/serving/autoscaling/autoscale-go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module autoscale-go

go 1.20