Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Please fix google-gke-kubectl-run, backup folder means an oversized image

Tommo
Contributor
September 5, 2023
  • the version of the pipe - 
    atlassian/google-gke-kubectl-run:3.0.0
  • relevant logs and error messages
    google-gke-kubectl-run:3.0.0-without-backup-folder <none> 61abf4e9da2d 20 seconds ago 2.08GB

    google-gke-kubectl-run:3.0.0 <none> f637d02b9abb 7 minutes ago 2.81GB
  • steps to reproduce
    Modify the various docker images and compare.


After consulting Google's version of the docker file https://github.com/GoogleCloudPlatform/cloud-sdk-docker/blob/master/debian_component_based/Dockerfile

And comparing that with Atlassian's version: https://bitbucket.org/atlassian/google-gke-kubectl-run/src/master/Dockerfile I conclude that the Atlassian pipe google-gke-kubectl-run lacks this step.

`rm -rf /google-cloud-sdk/.install/.backup`
As a result, the image is over 200MB larger as a result, over 25% larger than it needs to be. Since the image is over 700MB now, you should definitely remove the backup from your image.

More specifically, modify line 27:
- RUN ./google-cloud-sdk/install.sh --quiet
+ RUN ./google-cloud-sdk/install.sh --quiet && rm -rf /google-cloud-sdk/.install/.backup


Atlassian's "slim" version based on 442.0.0:
753.52 MB https://hub.docker.com/r/bitbucketpipelines/google-gke-kubectl-run/tags

Google's slim version:
424.6 MB https://hub.docker.com/r/google/cloud-sdk/tags?page=1&name=442.0.0-slim

Note that this is compressed size. The majority of that is the `/google-cloud-sdk/.install/.backup` folder but it looks like you might get 100MB smaller. 

Uncompressed I see 2.81GB vs 2.08GB just by removing the `/google-cloud-sdk/.install/.backup` directory.
Build just like it's set up in the Bitbucket:
> docker build -t docker build -t google-gke-kubectl-run:3.0.0 .

Modify line 27 as described and build:

> docker build -t google-gke-kubectl-run:3.0.0-without-backup-folder .
> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
google-gke-kubectl-run 3.0.0-without-backup-folder 61abf4e9da2d 20 seconds ago 2.08GB
google-gke-kubectl-run 3.0.0 f637d02b9abb 7 minutes ago 2.81GB

2 answers

1 accepted

1 vote
Answer accepted
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 21, 2023

@Tommo hi. New pipe version released with fixes you suggested.

 

Regards, Igor

Tommo
Contributor
September 25, 2023

Looks good to me. Saved 193MB.

1 vote
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 8, 2023

@Tommo hi. Thanks for your investigation. We will fix this in a future releases and notify you.

Regards, Igor

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events