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

lints: Add --fix, support with tmpfiles #1152

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cgwalters
Copy link
Collaborator

This needs some docs and some container tests but yeah

$ cat Dockerfile
FROM localhost/bootc
RUN <<EORUN
set -xeuo pipefail
mkdir -p /var/lib/some-test-dir
bootc container lint --fix
EORUN
$ podman build ...
+ bootc container lint --fix
tmpfiles.d: Generated: usr/lib/tmpfiles.d/bootc-autogenerated-var-0.conf with entries: 1
Checks passed: 11
Checks skipped: 1

But the big thing I realized here that makes things WAY messier is that actually we need to support retaining some of the /var subdirs...like /var/tmp and /var/lib/rpm-state as one wants them in the container too. Tentatively thinking something like

cat /usr/lib/bootc/tmpfiles.d/foo.conf
# Temporary directories we ensure are always present in the container too
/var/tmp

So what'd be cool about this is that at the end of a build one could switch from

rm -rf /var/tmp/* /var/lib/{dnf,rhsm} /var/cache/*

to

rm /var/*
bootc container lint --fix

And that'd automatically regenerate everything in /var needed.

But, mmm, it may drive us really to have something like bootc container commit that is defined to do both of those things?

It's clearer if `increment` mutates self.

Signed-off-by: Colin Walters <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant