You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/01/03 18:30:58 UTC

[jira] [Commented] (METRON-644) RPM builds only work with Docker for Mac

    [ https://issues.apache.org/jira/browse/METRON-644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15795753#comment-15795753 ] 

ASF GitHub Bot commented on METRON-644:
---------------------------------------

GitHub user kylerichardson opened a pull request:

    https://github.com/apache/incubator-metron/pull/409

    METRON-644 RPM builds only work with Docker for Mac

    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.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kylerichardson/incubator-metron METRON-644

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-metron/pull/409.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #409
    
----
commit b5d2168030e1acd9df490991f2a7f74124d71ba7
Author: kylerichardson <ky...@gmail.com>
Date:   2017-01-03T01:34:05Z

    METRON-644 Update rpm-docker build.sh
    
    Updated the script to account for non-existent user file ownership within
    the container.

commit f00bbd385e505128a8dcbc674e4630aadecabf92
Author: kylerichardson <ky...@gmail.com>
Date:   2017-01-03T04:18:22Z

    METRON-644 Correction based on Docker for Mac testing
    
    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.

commit 9683c3ec69d4982b9c86558e63194ba0b6382b85
Author: Kyle Richardson <ky...@users.noreply.github.com>
Date:   2017-01-03T18:19:00Z

    Update comments

----


> RPM builds only work with Docker for Mac
> ----------------------------------------
>
>                 Key: METRON-644
>                 URL: https://issues.apache.org/jira/browse/METRON-644
>             Project: Metron
>          Issue Type: Bug
>            Reporter: Kyle Richardson
>            Assignee: Kyle Richardson
>            Priority: Minor
>
> Currently using the rpm-docker container for building Metron RPMs will only work on Docker for Mac due to permissions issues on the SOURCE/* and SPEC/* files.
> When using docker-machine (e.g. boot2docker) or a local docker install on Linux, the build fails due to "Bad owner/group." After some research, this apparently occurs due to the uid/gid of the files not being a valid user and/or group in the container OS.
> I'd like to avoid changing permissions on these files to root, so that the developer can maintain non-root ownership of the files in his/her development environment. To do that, I propose adding a few checks to the build.sh script to:
> # check if the owner of the SPEC/metron.spec file exists in the container OS
> # if not, create that user
> # once the build is complete, change ownership of the build files (e.g. RPMs) to the original owner



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)