From f2f8df1c3e75dd525d912af71c52950926892c0e Mon Sep 17 00:00:00 2001 From: Haihan Jiang Date: Fri, 29 May 2026 19:00:10 -0700 Subject: [PATCH] Fix quickstart Dockerfile warnings --- quickstarts/hello-app-cdn/Dockerfile | 6 +++--- quickstarts/hello-app-redis/Dockerfile | 6 +++--- quickstarts/hello-app-tls/Dockerfile | 4 ++-- quickstarts/languages/go/Dockerfile | 2 +- quickstarts/languages/java/Dockerfile | 2 +- quickstarts/languages/python/Dockerfile | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/quickstarts/hello-app-cdn/Dockerfile b/quickstarts/hello-app-cdn/Dockerfile index 9f8d1cc197..961f6f55d6 100644 --- a/quickstarts/hello-app-cdn/Dockerfile +++ b/quickstarts/hello-app-cdn/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.24.3 as builder +FROM golang:1.24.3 AS builder WORKDIR /app RUN go mod init hello-app-cdn COPY *.go ./ @@ -21,6 +21,6 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o /hello-app-cdn FROM gcr.io/distroless/base-debian11 WORKDIR / COPY --from=builder /hello-app-cdn /hello-app-cdn -ENV PORT 8080 +ENV PORT=8080 USER nonroot:nonroot -CMD ["/hello-app-cdn"] \ No newline at end of file +CMD ["/hello-app-cdn"] diff --git a/quickstarts/hello-app-redis/Dockerfile b/quickstarts/hello-app-redis/Dockerfile index abfcaa0d6c..4259e2e651 100644 --- a/quickstarts/hello-app-redis/Dockerfile +++ b/quickstarts/hello-app-redis/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.24.3 as builder +FROM golang:1.24.3 AS builder WORKDIR /app RUN go mod init hello-app-redis COPY * ./ @@ -21,6 +21,6 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o /hello-app-redis FROM gcr.io/distroless/base-debian11 WORKDIR / COPY --from=builder /hello-app-redis /hello-app-redis -ENV PORT 8080 +ENV PORT=8080 USER nonroot:nonroot -CMD ["/hello-app-redis"] \ No newline at end of file +CMD ["/hello-app-redis"] diff --git a/quickstarts/hello-app-tls/Dockerfile b/quickstarts/hello-app-tls/Dockerfile index 6cd0481049..2f2239cb06 100644 --- a/quickstarts/hello-app-tls/Dockerfile +++ b/quickstarts/hello-app-tls/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.24.3 as builder +FROM golang:1.24.3 AS builder WORKDIR /app RUN go mod init hello-app-tls COPY *.go ./ @@ -22,4 +22,4 @@ FROM gcr.io/distroless/base-debian11 WORKDIR / COPY --from=builder /hello-app-tls /hello-app-tls USER nonroot:nonroot -CMD ["/hello-app-tls"] \ No newline at end of file +CMD ["/hello-app-tls"] diff --git a/quickstarts/languages/go/Dockerfile b/quickstarts/languages/go/Dockerfile index 218f98c6cb..5ffd2cf536 100644 --- a/quickstarts/languages/go/Dockerfile +++ b/quickstarts/languages/go/Dockerfile @@ -16,7 +16,7 @@ # Use the offical Go image to create a build artifact. # This is based on Debian and sets the GOPATH to /go. # https://hub.docker.com/_/golang -FROM golang:1.24.3 as builder +FROM golang:1.24.3 AS builder WORKDIR /app # Initialize a new Go module. diff --git a/quickstarts/languages/java/Dockerfile b/quickstarts/languages/java/Dockerfile index b749d9cd8e..9d2c00402a 100644 --- a/quickstarts/languages/java/Dockerfile +++ b/quickstarts/languages/java/Dockerfile @@ -15,7 +15,7 @@ # [START gke_quickstarts_languages_java_dockerfile] # Use the official maven/Java 8 image to create a build artifact. # https://hub.docker.com/_/maven -FROM maven:3.6-jdk-8-alpine as builder +FROM maven:3.6-jdk-8-alpine AS builder # Copy local code to the container image. WORKDIR /app diff --git a/quickstarts/languages/python/Dockerfile b/quickstarts/languages/python/Dockerfile index 99dbe43a3e..c090147d20 100644 --- a/quickstarts/languages/python/Dockerfile +++ b/quickstarts/languages/python/Dockerfile @@ -18,7 +18,7 @@ FROM python:3.13-slim # Copy local code to the container image. -ENV APP_HOME /app +ENV APP_HOME=/app WORKDIR $APP_HOME COPY . ./