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

Change JavaLayerConfiguration.set___Files to use the new API to add source files #1007

Closed
chanseokoh opened this issue Sep 19, 2018 · 1 comment
Assignees
Milestone

Comments

@chanseokoh
Copy link
Member

chanseokoh commented Sep 19, 2018

Current signature: setExtraFiles(List<Path> extraFiles)

Currently, the source files (extraFiles) should be top-level files and directories. If a source path is a directory, JavaLayerConfiguration calls LayerConfiguration.Builder.addEntryRecursive() to add all the files and sub-directories in the directory recursively. That is, it is not possible to separate files in a directory into different layers (much like the problem of #957). This is also problematic in the WAR case. For example,

WAR-root/
    index.html
    WEB-INF/
        classes/
            HelloServlet.class
            cool.properties
        web.xml

The resources layer should have

index.html                       -->  to be placed in <appRoot>
WEB-INF/web.xml                  -->  to be placed in <appRoot>
WEB-INF/classes/cool.properties  -->  to be placed in <appRoot>

which should be unpacked at the root of the application in an image, whereas the classes layer should have

WEB-INF/classes/HelloServlet.class  -->  to be placed in <appRoot>

or

HelloSevlet.class  -->  to be placed in <appRoot>/WEB-INF/classes

Fortunately, #956 is fixed, so we can now change setExtraFiles() to accept an explicit list of individual files to add. That is, instead of adding fiels with addEntryRecursive(), just add each file with addEntry(). However, it may be inconvenient for callers to always explicitly list all the files, so it'll be good to have setExtraFilesDirectory() and setExtraFilesDirectories() too.

@chanseokoh
Copy link
Member Author

chanseokoh commented Sep 19, 2018

One things to consider is, how this should work with JavaDockerContextGenerator (#1010).

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

No branches or pull requests

2 participants