Skip to content

Commit

Permalink
Merge pull request #295 from bobidle/unify-debian-based-images
Browse files Browse the repository at this point in the history
Unify Debian based Dockerfiles
  • Loading branch information
cloudsdkdocker authored Nov 1, 2023
2 parents fd4e639 + 84adf03 commit 7ca3308
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ FROM docker:24.0.7 as static-docker-source
FROM debian:bullseye
ARG CLOUD_SDK_VERSION
ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION
ENV PATH "$PATH:/opt/google-cloud-sdk/bin/"
COPY --from=static-docker-source /usr/local/bin/docker /usr/local/bin/docker
COPY --from=static-docker-source /usr/local/libexec/docker/cli-plugins/docker-buildx /usr/local/libexec/docker/cli-plugins/docker-buildx
RUN groupadd -r -g 1000 cloudsdk && \
useradd -r -u 1000 -m -s /bin/bash -g cloudsdk cloudsdk
RUN apt-get -qqy update && apt-get -qqy upgrade && apt-get install -qqy \
RUN apt-get update -qqy && apt-get -qqy upgrade && apt-get install -qqy \
curl \
python3-dev \
python3-crcmod \
Expand All @@ -19,8 +18,8 @@ RUN apt-get -qqy update && apt-get -qqy upgrade && apt-get install -qqy \
make \
gnupg && \
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \
echo "deb https://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" > /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" > /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | tee /usr/share/keyrings/cloud.google.gpg && \
apt-get update && \
apt-get install -y google-cloud-cli=${CLOUD_SDK_VERSION}-0 \
google-cloud-cli-app-engine-python=${CLOUD_SDK_VERSION}-0 \
Expand Down
2 changes: 1 addition & 1 deletion debian_component_based/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY --from=static-docker-source /usr/local/bin/docker /usr/local/bin/docker
COPY --from=static-docker-source /usr/local/libexec/docker/cli-plugins/docker-buildx /usr/local/libexec/docker/cli-plugins/docker-buildx
RUN groupadd -r -g 1000 cloudsdk && \
useradd -r -u 1000 -m -s /bin/bash -g cloudsdk cloudsdk
RUN apt-get -qqy update && apt-get -qqy upgrade && apt-get install -qqy \
RUN apt-get update -qqy && apt-get -qqy upgrade && apt-get install -qqy \
curl \
gcc \
python3-dev \
Expand Down
12 changes: 5 additions & 7 deletions debian_slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ FROM docker:24.0.7 as static-docker-source
FROM debian:bullseye-slim
ARG CLOUD_SDK_VERSION
ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION
ENV PATH "$PATH:/opt/google-cloud-sdk/bin/"
COPY --from=static-docker-source /usr/local/bin/docker /usr/local/bin/docker
COPY --from=static-docker-source /usr/local/libexec/docker/cli-plugins/docker-buildx /usr/local/libexec/docker/cli-plugins/docker-buildx
RUN groupadd -r -g 1000 cloudsdk && \
Expand All @@ -14,22 +13,21 @@ RUN apt-get update -qqy && apt-get -qqy upgrade && apt-get install -qqy \
curl \
gcc \
python3-dev \
python3-crcmod \
python3-pip \
apt-transport-https \
lsb-release \
openssh-client \
git \
gnupg && \
pip3 install -U crcmod && \
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \
echo "deb https://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" > /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" > /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | tee /usr/share/keyrings/cloud.google.gpg && \
apt-get update && apt-get install -y google-cloud-cli=${CLOUD_SDK_VERSION}-0 $INSTALL_COMPONENTS && \
gcloud config set core/disable_usage_reporting true && \
gcloud config set component_manager/disable_update_check true && \
gcloud config set metrics/environment github_docker_image && \
gcloud --version

gcloud --version && \
docker --version
RUN git config --system credential.'https://source.developers.google.com'.helper gcloud.sh

VOLUME ["/root/.config"]

0 comments on commit 7ca3308

Please sign in to comment.