[
https://issues.apache.org/jira/browse/MASSEMBLY-442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16881546#comment-16881546
]
Marat Abrarov edited comment on MASSEMBLY-442 at 7/9/19 9:11 PM:
-----------------------------------------------------------------
Here is my case when I need Maven Assembly Plugin to provide ability to specify
owner for files and directories (I need {{root:root}} actually):
# I use Maven Assembly Plugin to prepare TAR, because
## I use TARs with [{{ADD}} Dockerfile
directive|https://docs.docker.com/engine/reference/builder/#add]
## I have old Docker 1.13.1 (thanks to Red Hat and RHEL 7, don't tell me about
Podman which has no remote access which I need because of Windows) and cannot
use {{ADD --chown}} directive
## I have Linux and Windows build systems so TAR is the only option to add
files into Docker image with specific Unix file permissions (thanks to Maven
Assembly Plugin {{fileMode}} option)
## I cannot use {{RUN}} Dockerfile directive to change Unix file permissions
and / or owner because it duplicates files added with {{ADD}} or {{COPY}}
directives (the only simple way to add results of build into Docker image).
Refer to [The backlash of chmod/chown/mv in your
Dockerfile|https://medium.com/@lmakarov/the-backlash-of-chmod-chown-mv-in-your-dockerfile-f12fe08c0b55]
for details.
# When I build on Windows - refer to
[dockerfile-test|https://github.com/mabrarov/dockerfile-test] test project -
then files are added with {{root:root}} owner (that's acceptable for my case)
# When I build on Linux then files are added with build user as owner and
that's against of my needs (creates security issue in my case).
was (Author: abrarovm):
Here is my case when I need Maven Assembly Plugin to provide ability to specify
owner for files and directories (I need {{root:root}} actually):
# I use Maven Assembly Plugin to prepare TAR, because
## I use TARs with [{{ADD}} Dockerfile
directive|https://docs.docker.com/engine/reference/builder/#add]
## I have old Docker 1.13.1 (thanks to Red Hat and RHEL 7, don't tell me about
Podman which has no remote access which I need because of Windows) and cannot
use {{ADD --chown}} directive
## I have Linux and Windows build systems so TAR is the only option to add
files into Docker image with specific Unix file permissions (thanks to Maven
Assembly Plugin {{fileMode}} option)
## I cannot use {{RUN}} Dockerfile directive to change Unix file permissions
and / or owner because it duplicates files added with {{ADD}} or {{COPY}}
directives (the only simple way to add results of build into Docker image).
Refer to [The backlash of chmod/chown/mv in your
Dockerfile|https://medium.com/@lmakarov/the-backlash-of-chmod-chown-mv-in-your-dockerfile-f12fe08c0b55]
for details.
# When I build on Windows - refer to
[dockerfile-test|https://github.com/mabrarov/dockerfile-test] test project -
then files are added with {{root:root}} owner (that's acceptable for my case)
# When I build on Linux then files are added with build user as owner and
that's against of my needs.
> no way to avoid using detected user/group information for files and
> directories in tarballs
> -------------------------------------------------------------------------------------------
>
> Key: MASSEMBLY-442
> URL: https://issues.apache.org/jira/browse/MASSEMBLY-442
> Project: Maven Assembly Plugin
> Issue Type: Bug
> Affects Versions: 2.2-beta-4
> Reporter: John Casey
> Priority: Critical
>
> this involves quite a bit of new code, to support specifying
> user/group/uid/gid for all (files, fileSets, directories (unpacked,
> reformatted dependencies), and dependencies unpacked directly into the new
> archive.
> Moving to 2.3-beta-1.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)