Skip to content
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
4 changes: 2 additions & 2 deletions golang-sample/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Use the offical golang image to create a binary.
# This is based on Debian and sets the GOPATH to /go.
# https://hub.docker.com/_/golang
FROM golang:1.20-buster as builder
FROM golang:1.24-trixie as builder

# Create and change to the app directory.
WORKDIR /app
Expand All @@ -35,7 +35,7 @@ RUN go build -v -o server
# Use the official Debian slim image for a lean production container.
# https://hub.docker.com/_/debian
# https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds
FROM debian:buster-slim
FROM debian:trixie-slim
RUN set -x && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
Expand Down
16 changes: 8 additions & 8 deletions golang-sample/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,33 @@
# [START cloudbuild_go_test_yaml]
steps:
# Run tests and save to file
- name: golang:1.24
- name: golang:1.24-trixie
entrypoint: /bin/bash
args:
args:
- -c
- |
go install github.com/jstemmer/go-junit-report/v2@latest
2>&1 go test -timeout 1m -v ./... | /go/bin/go-junit-report -set-exit-code -iocopy -out ${SHORT_SHA}_test_log.xml
# [END cloudbuild_go_test_yaml]

# [START cloudbuild_go_image_yaml]
# Docker Build
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t',
args: ['build', '-t',
'us-central1-docker.pkg.dev/$PROJECT_ID/$_AR_REPO_NAME/myimage:$SHORT_SHA', '.']
# [END cloudbuild_go_image_yaml]

# [START cloudbuild_go_push_yaml]
# Docker push to Google Artifact Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'us-central1-docker.pkg.dev/$PROJECT_ID/$_AR_REPO_NAME/myimage:$SHORT_SHA']
# [END cloudbuild_go_push_yaml]

# [START cloudbuild_go_deploy_yaml]
# Deploy to Cloud Run
- name: 'gcr.io/cloud-builders/gcloud'
args: ['run', 'deploy', 'helloworld-${SHORT_SHA}',
'--image=us-central1-docker.pkg.dev/$PROJECT_ID/$_AR_REPO_NAME/myimage:$SHORT_SHA',
args: ['run', 'deploy', 'helloworld-${SHORT_SHA}',
'--image=us-central1-docker.pkg.dev/$PROJECT_ID/$_AR_REPO_NAME/myimage:$SHORT_SHA',
'--region', 'us-central1', '--platform', 'managed']
# [END cloudbuild_go_deploy_yaml]

Expand Down
2 changes: 1 addition & 1 deletion golang-sample/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/GoogleCloudPlatform/cloud-build-samples/golang

go 1.19
go 1.24
4 changes: 2 additions & 2 deletions run-example-builddeploy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Use the official golang image to create a binary.
# This is based on Debian and sets the GOPATH to /go.
# https://hub.docker.com/_/golang
FROM golang:1.20-buster as builder
FROM golang:1.24-trixie as builder

# Create and change to the app directory.
WORKDIR /app
Expand All @@ -35,7 +35,7 @@ RUN go build -v -o server
# Use the official Debian slim image for a lean production container.
# https://hub.docker.com/_/debian
# https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds
FROM debian:buster-slim
FROM debian:trixie-slim
RUN set -x && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
Expand Down
2 changes: 1 addition & 1 deletion run-example-builddeploy/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/GoogleCloudPlatform/cloud-build-samples/run-example-builddeploy

go 1.19
go 1.24
Loading