Trick to tell to docker maven plugin to copy some resources to a specific path

1,592 views
Skip to first unread message

Charles Moulliard

unread,
Jun 3, 2016, 6:52:01 AM6/3/16
to fab...@googlegroups.com
Hi,

My docker maven plugin uses an assembly file where the files / resources to be included within
the Docker image are defined

Example of such fileset to copy a user file to /secret/apiman-gateway/users folder

<!-- Apiman Gateway -->
        <fileSet>
            <directory>${project.basedir}/data</directory>
            <outputDirectory>/secret/apiman-gateway/users</outputDirectory>
            <includes>
                <include>gateway-user</include>
            </includes>
        </fileSet>

Here is the config of the Docker Maven Plugin

                <version>${docker.maven.plugin.version}</version>
                <configuration>
                    <images>
                        <image>
                            <name>${docker.image}</name>
                            <build>
                                <from>${docker.from}</from>
                                <assembly>
                                    <basedir>/deployments</basedir>
                                    <descriptor>${project.basedir}/src/main/resources/assemblies/apiman-gateway-app.xml</descriptor>
                                </assembly>

This config works very well excepted that all the content defined under this folder target/docker/fabric8/apiman-gateway/2.3-SNAPSHOT/build/maven will be copied to /deployments as defined within the Dockerfile generated 

COPY maven /deployments/

Is there a trick to tell to the plugin that by example this content

target/docker/fabric8/apiman-gateway/2.3-SNAPSHOT/build/maven/secret/apiman-gateway

must be copied to

/secret/apaiman-gateway/users 

?

Regards,

--
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Kurt Stam

unread,
Jun 5, 2016, 11:32:22 PM6/5/16
to Charles Moulliard, fab...@googlegroups.com
Hi Charles,

These files are brought in as k8s secrets. Hence the name of the path starting with /secret. Secrets are read only. 

Cheers,

--Kurt
--
You received this message because you are subscribed to the Google Groups "fabric8" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages