Send feedback
Example Dockerfiles
bookmark_border bookmark
Stay organized with collections
Save and categorize content based on your preferences.
Build your own gcloud Docker Image including docker-buildx
To get docker-buildx
dependency on the gcloud :alpine
image,
use the following Dockerfile:
FROM docker:28.1.1 as static-docker-source # get latest docker
FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:alpine
COPY --from= static-docker-source /usr/local/libexec/docker/cli-plugins/docker-buildx /usr/local/libexec/docker/cli-plugins/docker-buildx
To get docker-buildx
dependency on the gcloud
:debian_component_based
image, use the following Dockerfile:
FROM docker:28.1.1 as static-docker-source # get latest docker
FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:debian_component_based
COPY --from= static-docker-source /usr/local/libexec/docker/cli-plugins/docker-buildx /usr/local/libexec/docker/cli-plugins/docker-buildx
To get docker-buildx
dependency on the gcloud
:latest
image, use the following Dockerfile:
FROM docker:28.1.1 as static-docker-source # get latest docker
FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:latest
COPY --from= static-docker-source /usr/local/libexec/docker/cli-plugins/docker-buildx /usr/local/libexec/docker/cli-plugins/docker-buildx
To get docker-buildx
dependency on the gcloud
:slim
image, use the following Dockerfile:
FROM docker:28.0.4 as static-docker-source # get latest docker
FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:slim
COPY --from= static-docker-source /usr/local/libexec/docker/cli-plugins/docker-buildx /usr/local/libexec/docker/cli-plugins/docker-buildx
Build your own gcloud Docker Image with Java 21
To upgrade to Java 21 on the gcloud :latest
image,
use the following Dockerfile:
FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:latest
RUN curl -O https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb && \
apt install ./jdk-21_linux-x64_bin.deb
To upgrade to Java 21 on the gcloud :emulators
image,
use the following Dockerfile:
FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators
RUN curl -O https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb && \
apt install ./jdk-21_linux-x64_bin.deb
To upgrade to Java 21 on the gcloud :debian_component_based
image, use the following Dockerfile:
FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:debian_component_based
RUN curl -O https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb && \
apt install ./jdk-21_linux-x64_bin.deb
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-30 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-30 UTC."],[],[]]