-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #422 from GoogleCloudPlatform/stable-image
add new stable-alpha image
- Loading branch information
Showing
3 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM marketplace.gcr.io/google/debian12:latest as build_image | ||
|
||
ARG CLOUD_SDK_VERSION | ||
ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION | ||
ARG INSTALL_COMPONENTS | ||
|
||
RUN apt-get update -qqy && apt-get -qqy upgrade && \ | ||
apt-get install -qqy \ | ||
curl \ | ||
ca-certificates \ | ||
lsb-release \ | ||
gnupg && \ | ||
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \ | ||
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ | ||
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \ | ||
apt-get update && \ | ||
apt-get install -y google-cloud-cli=${CLOUD_SDK_VERSION}-0 $INSTALL_COMPONENTS &&\ | ||
rm -rf /root/.cache/pip/ && \ | ||
find / -name '*.pyc' -delete && \ | ||
find / -name '*__pycache__*' -delete | ||
FROM marketplace.gcr.io/google/debian12:latest as runtime_image | ||
COPY --from=build_image /usr/lib/google-cloud-sdk /usr/lib/google-cloud-sdk | ||
|
||
ENV PATH=$PATH:/usr/lib/google-cloud-sdk/bin | ||
# Create a non-root user | ||
RUN groupadd -r -g 1000 cloudsdk && \ | ||
useradd -r -u 1000 -m -s /bin/bash -g cloudsdk cloudsdk | ||
RUN if [ `uname -m` = 'x86_64' ]; then echo -n "x86_64" > /tmp/arch; else echo -n "arm" > /tmp/arch && \ | ||
apt-get update -qqy && apt-get -qqy upgrade && apt-get install -qqy \ | ||
python3-dev \ | ||
python3-crcmod; fi; | ||
RUN gcloud --version && \ | ||
gcloud config set core/disable_usage_reporting false && \ | ||
gcloud config set component_manager/disable_update_check true && \ | ||
rm -rf /root/.cache/pip/ && \ | ||
find / -name '*.pyc' -delete && \ | ||
find / -name '*__pycache__*' -delete | ||
VOLUME ["/root/.config"] |