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

Globally prefer podman and better cross platform support #627

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

Conversation

lisa
Copy link
Contributor

@lisa lisa commented Apr 12, 2024

There were some targets in the Makefile that were hardcoded to use the docker binary. They have been changed to use $(CONTAINER_ENGINE), which will prefer podman and fall back to docker.

In order to better support non-Linux platforms, some auto-detection is done for the OS and if Linux is detected, container volumes will be mounted with :z to facilicate SELinux labels (which are not supported on MacOS with Podman). There are two ways to override the auto-detection. To pretend to not be Linux: make UNAME=Unknown (or whichever platform). To remain Linux (for example) but disable SELinux mount: make SELINUX_MOUNT_CHAR=

lisa and others added 2 commits April 12, 2024 15:41
There were some targets in the Makefile that were hardcoded to use the
docker binary. They have been changed to use `$(CONTAINER_ENGINE)`,
which will prefer podman and fall back to docker.

In order to better support non-Linux platforms, some auto-detection is
done for the OS and if Linux is detected, container volumes will be
mounted with `:z` to facilicate SELinux labels (which are not supported
on MacOS with Podman). There are two ways to override the
auto-detection. To pretend to _not_ be Linux: `make UNAME=Unknown` (or
whichever platform). To remain Linux (for example) but disable SELinux
mount: `make SELINUX_MOUNT_CHAR=`

Signed-off-by: Lisa Seelye <[email protected]>
Copy link
Contributor

@cubismod cubismod left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +44 to +47
-v $(PWD)/schemas:/schemas$(SELINUX_MOUNT_CHAR) \
-v $(PWD)/graphql-schemas:/graphql$(SELINUX_MOUNT_CHAR) \
-v $(PWD)/fake_data:/data$(SELINUX_MOUNT_CHAR) \
-v $(PWD)/fake_resources:/resources$(SELINUX_MOUNT_CHAR) \
Copy link
Contributor

Choose a reason for hiding this comment

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

:z means to share with multiple containers, I don't see where are we using that feature, all volume binds in this file are just read only mount, a simple :ro should be good enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hemslo With regard to :z, while you are correct, the container engine facilitates the sharing through SELinux labels, which aren't available outside a SELinux-enabled environment (such as MacOS).

If we want to change the flag to :ro later, we can do that at a later date. I want this change to be minimal in scope without potentially breaking changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then can we only keep @$(CONTAINER_ENGINE) changes in this pr, or just remove :z in both cases? :ro is a good to have suffix to indicate readonly, then that system check is also not needed anymore, seems small enough to be included all in one change.

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