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

Build Docker images for Ubuntu 22.04 and 24.04 #318

Merged
merged 10 commits into from
Jan 11, 2025

Conversation

joelberkeley
Copy link
Contributor

@joelberkeley joelberkeley commented Jan 4, 2025

what is this PR? #317

@joelberkeley joelberkeley marked this pull request as ready for review January 5, 2025 20:47
@stefan-hoeck
Copy link
Owner

Thanks a lot for this. I'm not very familiar with docker, so if someone else might want to step in and review this. Otherwise, I'll just merge it and see what happens.

Copy link
Contributor

@mattpolzin mattpolzin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look reasonable but if you wanted to be more idiomatic about it then the Ubuntu version would go in the tag rather than part of the name of the docker image. Also you’d use the code name.

So we’d have $IMAGE_ID:$DB_VERSION-jammy and $IMAGE_ID:$DB_VERSION-noble. The latest tag is usually just aliased to the latest version of the image and the latest version of the most popular base image it uses (so Ubuntu Noble Numbat in this case).

there are naturally many examples of this naming/tagging scheme, but here’s one at random if you want to see it play out at scale on a big project: https://hub.docker.com/_/golang

@joelberkeley
Copy link
Contributor Author

joelberkeley commented Jan 10, 2025

Thanks Matt,

Fortunately ubuntu images allow either ubuntu:22.04 or ubuntu:jammy, so we don't have to map them

@joelberkeley
Copy link
Contributor Author

I might suggest that we also have tags :noble and :jammy (no pack db version). It makes the code easier and I'm guessing from their tag list also what golang docker does. These are just the latest pack DB with respective ubuntu releases

run: |
export NO_CACHE="${{ github.ref == 'refs/heads/main' }}"
DB="$DB_VERSION" make docker-build
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DB="$DB_VERSION" didn't appear to be doing anything 🤔

@joelberkeley
Copy link
Contributor Author

ok I think it's all good now

@mattpolzin
Copy link
Contributor

I might suggest that we also have tags :noble and :jammy (no pack db version). These are just the latest pack DB with respective ubuntu releases

Sounds good. As you noted, golang and others do this as well — big projects do tons of aliasing so you can do things like :1 to refer to “latest 1.x.x” as well. There’s no need to go crazy for pack’s docker image (not to mention SemVer being an irrelevant example), but the pattern has precedent.

@joelberkeley
Copy link
Contributor Author

joelberkeley commented Jan 10, 2025

indeed, i've just noticed that the tag :noble is exactly why I made this PR: I need the latest pack, but I want to pin the ubuntu release

@joelberkeley
Copy link
Contributor Author

@stefan-hoeck matt's approved, ready to merge when you are

@stefan-hoeck
Copy link
Owner

Thanks again, and thanks @mattpolzin for reviewing this.

@stefan-hoeck stefan-hoeck merged commit 494967f into stefan-hoeck:main Jan 11, 2025
7 checks passed
@joelberkeley joelberkeley deleted the docker-ubuntu-version branch January 11, 2025 12:52
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.

3 participants