Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Eigenes gcloud-Docker-Image mit docker und docker-buildx erstellen
Wenn Sie die Abhängigkeit docker und / oder docker-buildx vom gcloud-Image :alpine abrufen möchten, verwenden Sie das folgende Dockerfile:
FROMdocker:28.2.2asstatic-docker-source#getlatestdocker
FROMgcr.io/google.com/cloudsdktool/google-cloud-cli:alpine# Comment the line below if you don't want `docker`COPY--from=static-docker-source/usr/local/bin/docker/usr/local/bin/docker
# Comment the line below if you don't want `docker-buildx`COPY--from=static-docker-source/usr/local/libexec/docker/cli-plugins/docker-buildx/usr/local/libexec/docker/cli-plugins/docker-buildx
Wenn Sie die docker- und / oder docker-buildx-Abhängigkeit vom gcloud-:debian_component_based-Image abrufen möchten, verwenden Sie das folgende Dockerfile:
FROMdocker:28.2.2asstatic-docker-source#getlatestdocker
FROMgcr.io/google.com/cloudsdktool/google-cloud-cli:debian_component_based# Comment the line below if you don't want `docker`COPY--from=static-docker-source/usr/local/bin/docker/usr/local/bin/docker
# Comment the line below if you don't want `docker-buildx`COPY--from=static-docker-source/usr/local/libexec/docker/cli-plugins/docker-buildx/usr/local/libexec/docker/cli-plugins/docker-buildx
Wenn Sie die docker- und / oder docker-buildx-Abhängigkeit vom gcloud-:latest-Image abrufen möchten, verwenden Sie das folgende Dockerfile:
FROMdocker:28.2.2asstatic-docker-source#getlatestdocker
FROMgcr.io/google.com/cloudsdktool/google-cloud-cli:latest# Comment the line below if you don't want `docker`COPY--from=static-docker-source/usr/local/bin/docker/usr/local/bin/docker
# Comment the line below if you don't want `docker-buildx`COPY--from=static-docker-source/usr/local/libexec/docker/cli-plugins/docker-buildx/usr/local/libexec/docker/cli-plugins/docker-buildx
Wenn Sie die docker- und / oder docker-buildx-Abhängigkeit vom gcloud-:slim-Image abrufen möchten, verwenden Sie das folgende Dockerfile:
FROMdocker:28.2.2asstatic-docker-source#getlatestdocker
FROMgcr.io/google.com/cloudsdktool/google-cloud-cli:slim# Comment the line below if you don't want `docker`COPY--from=static-docker-source/usr/local/bin/docker/usr/local/bin/docker
# Comment the line below if you don't want `docker-buildx`COPY--from=static-docker-source/usr/local/libexec/docker/cli-plugins/docker-buildx/usr/local/libexec/docker/cli-plugins/docker-buildx
Eigenes gcloud-Docker-Image mit make erstellen
Verwenden Sie das folgende Dockerfile, um make für das gcloud-:latest-Image zu erhalten:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-25 (UTC)."],[],[],null,["# Example Dockerfiles\n\nBuild your own gcloud Docker Image including `docker` and `docker-buildx`\n-------------------------------------------------------------------------\n\n- To get `docker` and / or `docker-buildx` dependency on the gcloud `:alpine` image, use the following Dockerfile:\n\n FROM docker:28.2.2 as static-docker-source # get latest docker\n FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:alpine\n # Comment the line below if you don't want `docker`\n COPY --from=static-docker-source /usr/local/bin/docker /usr/local/bin/docker\n # Comment the line below if you don't want `docker-buildx`\n COPY --from=static-docker-source /usr/local/libexec/docker/cli-plugins/docker-buildx /usr/local/libexec/docker/cli-plugins/docker-buildx\n\n- To get `docker` and / or `docker-buildx` dependency on the gcloud `:debian_component_based` image, use the following Dockerfile:\n\n FROM docker:28.2.2 as static-docker-source # get latest docker\n FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:debian_component_based\n # Comment the line below if you don't want `docker`\n COPY --from=static-docker-source /usr/local/bin/docker /usr/local/bin/docker\n # Comment the line below if you don't want `docker-buildx`\n COPY --from=static-docker-source /usr/local/libexec/docker/cli-plugins/docker-buildx /usr/local/libexec/docker/cli-plugins/docker-buildx\n\n- To get `docker` and / or `docker-buildx` dependency on the gcloud `:latest` image, use the following Dockerfile:\n\n FROM docker:28.2.2 as static-docker-source # get latest docker\n FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:latest\n # Comment the line below if you don't want `docker`\n COPY --from=static-docker-source /usr/local/bin/docker /usr/local/bin/docker\n # Comment the line below if you don't want `docker-buildx`\n COPY --from=static-docker-source /usr/local/libexec/docker/cli-plugins/docker-buildx /usr/local/libexec/docker/cli-plugins/docker-buildx\n\n- To get `docker` and / or `docker-buildx` dependency on the gcloud `:slim` image, use the following Dockerfile:\n\n FROM docker:28.2.2 as static-docker-source # get latest docker\n FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:slim\n # Comment the line below if you don't want `docker`\n COPY --from=static-docker-source /usr/local/bin/docker /usr/local/bin/docker\n # Comment the line below if you don't want `docker-buildx`\n COPY --from=static-docker-source /usr/local/libexec/docker/cli-plugins/docker-buildx /usr/local/libexec/docker/cli-plugins/docker-buildx\n\nBuild your own gcloud Docker Image with `make`\n----------------------------------------------\n\n- To get `make` on the gcloud `:latest` image, use the following Dockerfile:\n\n FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:latest\n RUN apt-get update -qqy && apt-get -qqy upgrade && apt-get install -qqy make\n\n- To get `make` on the gcloud `:debian_component_based` image, use the following Dockerfile:\n\n FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:debian_component_based\n RUN apt-get update -qqy && apt-get -qqy upgrade && apt-get install -qqy make\n\nBuild your own gcloud Docker Image with Java 21\n-----------------------------------------------\n\n- To upgrade to Java 21 on the gcloud `:latest` image, use the following Dockerfile:\n\n FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:latest\n RUN curl -O https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb && \\\n apt install ./jdk-21_linux-x64_bin.deb\n\n- To upgrade to Java 21 on the gcloud `:emulators` image, use the following Dockerfile:\n\n FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators\n RUN curl -O https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb && \\\n apt install ./jdk-21_linux-x64_bin.deb\n\n- To upgrade to Java 21 on the gcloud `:debian_component_based` image, use the following Dockerfile:\n\n FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:debian_component_based\n RUN curl -O https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb && \\\n apt install ./jdk-21_linux-x64_bin.deb"]]