Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

METRON-644 RPM builds only work with Docker for Mac #409

Closed
wants to merge 4 commits into from

Conversation

kylerichardson
Copy link
Contributor

Currently using the rpm-docker image to build the project RPMs will only succeed using Docker for Mac due to the way it handles permissions. When using docker-machine/boot2docker, "Bad owner/group" build errors occur due to the SPEC and SOURCE files having an owner uid which does not map to an existing user within the container.

Some background. When using Docker for Mac any volume mounted from the host into the container is munged into being owned by the running user within the container. Hence there are no permissions issues like we see with docker-machine/boot2docker.

Modified the build.sh script to ensure the owner uid of the metron.spec file maps to an existing user in the container and that the rpms post-build are owned by the same user.

Tested on Docker for Mac, docker-machine/boot2docker, and a local docker-engine on Linux. RPMs build as expected in each case.

kylerichardson and others added 3 commits January 4, 2017 12:51
Updated the script to account for non-existent user file ownership within
the container.
Using Docker for Mac, the id command returns non-zero for
UID=0. Account for this behavior by ignoring UID=0 as root
will always exist.
@justinleet
Copy link
Contributor

Thanks for doing this, it'll be really nice to not be dependent on Docker for Mac for this. Could you also update the prereqs (and any other necessary docs) in README.md in metron-deployment?

@kylerichardson
Copy link
Contributor Author

@justinleet Good catch. Updated the README to remove the note about Docker for Mac.

@justinleet
Copy link
Contributor

I'm +1 by inspection, given that you've run through testing it on a couple platforms.

@asfgit asfgit closed this in 52aa580 Jan 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants