Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

chore: add Containerfile with website build dependencies #178

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

akdev1l
Copy link
Contributor

@akdev1l akdev1l commented Apr 20, 2023

Also added a wrapper for poetry so we random contributors don't need to install poetry on their systems.

Also added a wrapper for poetry so we random contributors don't need
to install poetry on their systems.
@@ -0,0 +1,3 @@
FROM fedora-minimal:38
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason for using fedora-minimal here other than uBlue being related to the Fedora project. From what I'm seeing it's not an official image either, and I doubt it's much smaller (it's probably larger) than the alpine image's 5mb.
Besides, some casual users of containerized tools might have the alpine layers cached already.

Copy link
Contributor

Choose a reason for hiding this comment

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

My thoughts, though obviously I didn't contribute the file. :-)

Running a Fedora distro, with Fedora packaging, working on ublue and ucore, all with Fedora packages, I like keeping my toolkit as consistent as possible.

As an example, I use a fedora:38 distrobox image if I'm running on Silverblue:38, but a fedora:37 distrobox image when running on Silverblue:37.

I prefer to use fedora images to minimize drift in versions, library dependencies, etc. So, I generally don't use alpine, arch, debian, or ubuntu images for that reason. Yes, I give up some disk space perhaps, and it does cost a bit more in download bandwidth on occasion, but I have more consistency in the tooling. So it's a trade off.

Now, if I'm developing an image to distribute, where there may be a significant cost to scale of many downloads in a kubernetes cluster, and I'm trying to optimize for small layers or total size, I'll definitely look at the benefits of other base images and if they are worthwhile. That said, I have been bitten by the "python DNS issues" on alpine's musl before, so I'm not always eager to use it there either.

Copy link
Contributor

Choose a reason for hiding this comment

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

That was really long and wordy LOL

TL;DR

If we want to publish an image to share for download, use and not tinker with, I lean alpine.

If I'm building locally and think I may need to tinker and integrate with local system, I lean fedora-minimal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mm I thought Fedora minimal was official: https://fedoramagazine.org/building-smaller-container-images/

it is referenced here and in other Fedora documentation and it seems hosted in the Fedora registry

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bsherman is pretty accurate with his comment :)

I prefer consistent tooling so I like Fedora on Fedora in most cases

Copy link
Member

Choose a reason for hiding this comment

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

Mm I thought Fedora minimal was official: https://fedoramagazine.org/building-smaller-container-images/

it is referenced here and in other Fedora documentation and it seems hosted in the Fedora registry

Apparently the one on the Fedora registry should be official, but doesn't not-specifying the registry use docker.io, where there also is a fedora-minimal but which is unofficial. Well, correct me if I'm wrong.

Copy link
Contributor

@bsherman bsherman left a comment

Choose a reason for hiding this comment

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

Love this! I'm probably going to steal this poetry shell script for my daily use.

@@ -0,0 +1,3 @@
FROM fedora-minimal:38

RUN dnf5 install -y poetry git
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're going to put poetry in a container I'd prefer we use latest upstream vs distro version

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a good point. I realized even F38 doesn't have poetry 2+ in repo, so I can't use it for my projects the way I mentioned above.

Of course, this is sending us down the path of creating a generic poetry image. :-)

If there's a generic poetry image done separate from this, then this PR would change to "install poetry (see website for instructions) or just use this shell alias to run a docker container.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not against that but there's no official image: python-poetry/poetry#4036

I prefer to get my tooling from fedora for the most part and didn't really look at what upstream recommends from installing, if you know how to do that I can amend this PR

The script is really what makes things easy, the container itself isn't too relevant imo

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm actively working on something to contribute here... not quite ready yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can run the get-poetry setup in the container in the run line here vs the dnf command. I'll wait and see what @bsherman has though

@bsherman
Copy link
Contributor

bsherman commented May 4, 2023

So, a lot of chatter here, and also in Discord on this topic...

Summary:
I created a containerized poetry image (based on alpine). I'm doing daily builds, pulling latest versions of python & poetry... publishing in ghcr.io .

I tested with this website repo's instructions for using poetry to run mkdocs, but using my container image (via a shell alias) instead of an installed copy of poetry.

Seeing that it works well, I started modifying this PR. However, I'm unsure of the "github way" to modify this significantly, without pushing back to @akdev1l 's branch. So I pushed my changes to a branch local to this repo: https://github.com/ublue-os/website/tree/akdev1l/main

@akdev1l , if you want to merge that branch into your repo, you should be able to push those changes back into this PR and we can then wrap it up. Of course, feel free to tweak my README modifications.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants