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

Figure out how to use our Docker images locally #2474

Closed
Minoru opened this issue Jun 25, 2023 · 0 comments · Fixed by #2729
Closed

Figure out how to use our Docker images locally #2474

Minoru opened this issue Jun 25, 2023 · 0 comments · Fixed by #2729
Labels
docker Pull requests that update Docker code docs This issue relates to Newsboat documentation

Comments

@Minoru
Copy link
Member

Minoru commented Jun 25, 2023

We have a bunch of Dockerfiles which are used by our CI and can also be utilized by users who want to build Newsboat from source. These Dockerfiles have instructions on how to run the images locally:

# docker run \
# --rm \
# --mount type=bind,source=$(pwd),target=/home/builder/src \
# --user $(id -u):$(id -g) \
# newsboat-build-tools \
# make

There are two problems with this:

  1. it requires users inside and outside Docker to match (have same GID and UID), which might not be the case if e.g. a machine has multiple user accounts;
  2. it means our Dockerfiles have some hard-coded UID and GID (1000 and 1000 currently), so people know what UID/GID they have to provide.

This worked well enough so far, probably because people who tried Docker locally only had one user account on their machine (with UID/GID 1000/1000). However, Ubuntu 23.04 image for Docker comes with "ubuntu" user, so we'd have to adjust the recipes for it.

This is an opportunity to re-think how we do local builds with Docker. The goals are:

  1. Dockerfiles can be used in CI
  2. Dockerfiles can be used to produce local Docker images, from which one can start a container with Newsboat sources mapped into it, and build from that source
  3. the instructions to perform item 2 should be uniform for all our Dockerfiles. It's okay if Dockerfiles themselves are quite different

We could probably achieve that if we deleted the default "ubuntu" user in Ubuntu 23.04, but I'm not sure if that won't break something. We could also look for alternatives; perhaps the existing docker run --user ... --mount ... approach is wrong.

@Minoru Minoru added docs This issue relates to Newsboat documentation docker Pull requests that update Docker code labels Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Pull requests that update Docker code docs This issue relates to Newsboat documentation
Projects
None yet
1 participant