Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate to golang:bookworm image #1070

Merged
merged 1 commit into from
Nov 25, 2024
Merged

Conversation

jmhodges
Copy link
Contributor

@jmhodges jmhodges commented Nov 25, 2024

This allows us to keep up to date with recent Go releases and security
patches while reducing our configuration in the Dockerfile. We'll bump
the Go version in a separate change.

@jmhodges jmhodges marked this pull request as ready for review November 25, 2024 06:39
@jmhodges jmhodges requested review from a team as code owners November 25, 2024 06:39
@jmhodges jmhodges requested review from bhearsum and removed request for a team November 25, 2024 06:39
This allows us to keep up to date with recent Go releases and security
patches while reducing our configuration in the Dockerfile. We'll bump
the Go version in a separate change.
@jmhodges jmhodges force-pushed the migrate-to-golang-image-gnight branch from ff548a7 to 20da762 Compare November 25, 2024 06:50
@oskirby
Copy link
Contributor

oskirby commented Nov 25, 2024

FWIW, I have noticed from other Go projects I have worked on - this does increase the size of the docker image by several hundred MBs as the official golang images are way bigger than the base debian images.

@jmhodges
Copy link
Contributor Author

FWIW, I have noticed from other Go projects I have worked on - this does increase the size of the docker image by several hundred MBs as the official golang images are way bigger than the base debian images.

@oskirby This isn't true for us. The debian version is gigabytes larger.

I built this version as

docker build -t golangimage .

and the original version on main as

docker build -t debimage . 

Then I ran both

$  docker images | egrep '(debimage|golangimage)'
debimage              latest            fa11a2658e4b   6 minutes ago    6.25GB
golangimage           latest            0ae92623ffc8   10 minutes ago   4.05GB

and also

$ docker save -o golangimage.tar golangimage
$ docker save -o debimage.tar debimage
$ ls -lh *.tar
-rw-------@ 1 jhodges  staff   2.3G Nov 25 09:04 debimage.tar
-rw-------@ 1 jhodges  staff   1.2G Nov 25 09:01 golangimage.tar

And both returned 1-2 GB more.

@oskirby
Copy link
Contributor

oskirby commented Nov 25, 2024

I stand corrected.

Also, wow those are some big images.

@jmhodges
Copy link
Contributor Author

@oskirby My data was bad because I had a dirty workspace and, as you pointed out in Slack, we have the thing that ADD all of the code to it.

With a clean working space, the debian comes out ahead by about 100MB or more.

$  ls -lh *.tar                                  
-rw-------@ 1 jhodges  staff   507M Nov 25 09:40 debimage.tar
-rw-------@ 1 jhodges  staff   609M Nov 25 09:42 golangimage.tar
$  docker images | egrep '(debimage|golangimage)'
golangimage   latest    c257b106e395   About a minute ago   2.55GB
debimage      latest    347d368c9a08   3 minutes ago        2.14GB

@jmhodges
Copy link
Contributor Author

jmhodges commented Nov 25, 2024

The ability to use a newer Go is worth the extra 100MB to me. (Security updates and features, both)

@oskirby
Copy link
Contributor

oskirby commented Nov 25, 2024

The ability to use a newer Go is worth the extra 100MB to me. (Security updates and features, both)

I think that's fine. Yeah

@jmhodges jmhodges merged commit 1319a97 into main Nov 25, 2024
14 checks passed
@jmhodges jmhodges deleted the migrate-to-golang-image-gnight branch November 25, 2024 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants