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

file permissions not set when 'fileMode' set in assembly descriptor #51

Closed
jgangemi opened this issue Nov 21, 2014 · 10 comments
Closed
Labels
Milestone

Comments

@jgangemi
Copy link
Collaborator

i have the following in my assembly descriptor (it's just the relevant snippet)

<fileSet>
  <directory>${project.build.scriptSourceDirectory}</directory>
  <outputDirectory>/</outputDirectory>
  <filtered>true</filtered>
  <includes>
    <include>startup.sh</include>
   </includes>
   <fileMode>755</fileMode>
</fileSet>

when my container gets built, the startup script doesn't have the correct permissions. i'm not sure if this something that should work in the context of this plugin or not.

i also tried setting the permission directly on the local filesystem to see if they carry over but was unsuccessful there as well. right now i'm working around this by specifying bash startup.sh as the command but that somewhat less then idea.

is this a bug? if not, do you have any suggestions on how this could be handled? i want this contained within the data container that gets built rather then mucking w/ the image that will be running it (which in this case is the 'official' tomcat instance).

@rhuss
Copy link
Collaborator

rhuss commented Dec 5, 2014

Good question. Will look into this for the next release, have to check the maven assembly plugin how it does the permission checks.

@rhuss rhuss added this to the 0.10.6 milestone Dec 5, 2014
@jgangemi
Copy link
Collaborator Author

jgangemi commented Dec 6, 2014

i have a fix for this - it will be included w/ the rest of the assembly enhancements.

@jgangemi
Copy link
Collaborator Author

jgangemi commented Feb 4, 2015

this was fixed in 0.11.0

@jgangemi jgangemi closed this as completed Feb 4, 2015
@dcalmbach
Copy link

Hi, i'm using version 0.11.2 and it seems that this issue is not fixed. i explored the temporary tar from assembly plugin which takes care of filemode, the tar created by maven-docker-plugin does not.

@rhuss rhuss reopened this Mar 19, 2015
@rhuss rhuss modified the milestones: 0.11.3, 0.11.0 Mar 19, 2015
@dcalmbach
Copy link

Perhaps its a windows issue since i'm building on a windows box

@rhuss
Copy link
Collaborator

rhuss commented Mar 19, 2015

Thanks for reporting, I'll try to have a look for this.

@jgangemi
Copy link
Collaborator Author

i'm thinking this is windows related b/c the above works for me on a mac and linux machines.

@jgangemi
Copy link
Collaborator Author

also, what is the value of fileMode? i just realized what i posted above it slightly incorrect and it should be <fileMode>0755</fileMode>

trying to google but not coming up w/ much - it's possible this is a bug in the assembly plugin.

can you also post your assembly.xml? :)

also what version of the assembly plugin did you try? i see there have been some bug fixes related to some file permissions. the docker-maven-plugin is using 2.5.1 where the latest version is 2.5.3.

@dcalmbach
Copy link

my assembly.xml was :

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
    <id>docker</id>
    <fileSets>
        <fileSet>
            <directory>${project.basedir}/src/main/docker/tagr</directory>
            <outputDirectory>/</outputDirectory>
            <includes>
                <include>**/*</include>
            </includes>
        </fileSet>
       <filemode>755</filemode>
    </fileSets>
</assembly>

It is not a bug of the assembly plugin since creating a tar with mvn assembly:single -Ddescriptor=src/main/docker/assembly.xml creates the right attributes. And its surely a windows issue, since building on linux/macos creates the correct images.

@efollea
Copy link
Contributor

efollea commented Apr 8, 2015

The problem is that the fat/ntfs, or any other file system like this ones, does not support linux like rights.
The proposed solution (#139) is to use as intermediary a system that does not rely on underling File system but the linux rights (ie: a tgz archive.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants