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: Add the ability to override the FRR UID during docker creation #17520

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

mikemallin
Copy link
Contributor

@mikemallin mikemallin commented Nov 26, 2024

This PR adds the ability to override the UID of the FRR user with the additional docker argument --build-arg=UID=$(id -u).

When using docker containers to develop FRR, it is much easier to manage copying files in and out of the container if the UID of the FRR user is also the same as the user that created the container.

For reference, I use the following commands to create my local development container:

docker build -t $(whoami)-$(basename `/bin/pwd`)-frr-ubuntu20:latest --build-arg=UBUNTU_VERSION=20.04 --build-arg=UID=$(id -u) -f docker/ubuntu20-ci/Dockerfile .

docker run --init -it --privileged --name $(whoami)-$(basename `/bin/pwd`)-frr-ubuntu20 -v /lib/modules:/lib/modules -v `/bin/pwd`:/home/frr/frr $(whoami)-$(basename `/bin/pwd`)-frr-ubuntu20:latest bash

docker start $(whoami)-$(basename `/bin/pwd`)-frr-ubuntu20

Signed-off-by: Mike RE Mallin <[email protected]>
Signed-off-by: Mike RE Mallin <[email protected]>
@mikemallin mikemallin force-pushed the dev/ubuntu-docker-custom-uid branch from 56a8167 to d643190 Compare November 26, 2024 17:19
@frrbot frrbot bot added the docker label Nov 26, 2024
@ton31337 ton31337 merged commit 9d118e3 into FRRouting:master Nov 28, 2024
13 checks passed
@mikemallin mikemallin deleted the dev/ubuntu-docker-custom-uid branch December 2, 2024 16:56
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.

3 participants