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

Docker build as root fixups #194

Merged
merged 4 commits into from
Jun 23, 2022
Merged

Conversation

bpkroth
Copy link
Collaborator

@bpkroth bpkroth commented Jun 21, 2022

Fixes #193

containeruser UID GID fixups for when using the script to build as root.

Use CONTAINERUSER_UID CONTAINERUSER_GID instead of UID GID directly.

Allow those to be supplied as environment variable overrides (e.g. CONTAINERUSER_UID=1234 ./build-full-image.sh)

If not available, default to UID GID as before.

If those are 0 (root, which already exists in the container), then try
to look at the SUDO_UID environment variable.

Also fixes up the Dockerfile to support creating a containeruser with an overlapping uid (e.g. 0) in case all of the above workarounds are insufficient.

bpkroth added 2 commits June 21, 2022 11:56
Use CONTAINERUSER_UID CONTAINERUSER_GID instead of UID/GID directly.

Allow those to be supplied as environment variable overrides.

If not available, default to UID/GID as before.

If those are 0 (root, which already exists in the container), then try
to look at the SUDO_UID environment variable.

Note: It doesn't yet handle the fixup required to the RUN command if
those are still set to 0.
@bpkroth bpkroth marked this pull request as ready for review June 22, 2022 19:15
Copy link
Member

@apavlo apavlo left a comment

Choose a reason for hiding this comment

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

LGTM

@apavlo apavlo merged commit 16e0ad6 into cmu-db:main Jun 23, 2022
@bpkroth bpkroth deleted the docker-build-as-root-fixups branch December 11, 2023 16:55
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.

docker build image --> addgroup: The GID `0' is already in use
2 participants