Resources not copied into image

236 views
Skip to first unread message

Stephan Wissel

unread,
Jun 23, 2020, 2:28:39 PM6/23/20
to Jib users
Did my first attempt on Jib with partial success. This is my config:

<plugin>

<groupId>com.google.cloud.tools</groupId>

<artifactId>jib-maven-plugin</artifactId>

<version>${jib.maven.plugin.version}</version>

<configuration>

<from>

<image>docker.hcllabs.net/hclcom/domino:11.0.1</image>

</from>

<to>

<image>myimage</image>

<tags>one,two,three</tags>

</to>

<extraDirectories>

<paths>

<path>

<from>src/main/docker/scripts</from>

<into>/opt/hcl/domino/scripts</into>

</path>

</paths>

<permissions>

<permission>

<file>/opt/hcl/domino/scripts/post_shutdown_script</file>

<mode>555</mode>

</permission>

<permission>

<file>/opt/hcl/domino/scripts/post_startup_script</file>

<mode>555</mode>

</permission>

<permission>

<file>/opt/hcl/domino/scripts/pre_shutdown_script</file>

<mode>555</mode>

</permission>

<permission>

<file>/opt/hcl/domino/scripts/keep_entry_point.sh</file>

<mode>555</mode>

</permission>

</permissions>

</extraDirectories>

<container>

<creationTime>USE_CURRENT_TIMESTAMP</creationTime>

<appRoot>/opt/hcl/keep</appRoot>

<entrypoint>

<entry>/opt/hcl/domino/scripts/keep_entry_point.sh</entry>

</entrypoint>

<ports>

<port>1352</port>

<port>80</port>

<port>389</port>

<port>8880</port>

<port>8889</port>

<port>8890</port>

</ports>

<user>notes</user>

<volumes>

<volume>/local/notesdata</volume>

</volumes>

</container>

</configuration>

<executions>

<execution>

<phase>package</phase>

<goals>

<goal>dockerBuild</goal>

</goals>

</execution>

</executions>

</plugin>

Image creation happens, second run is faster, class and jar files are where we expect them. Only thing that didn't come across: resources. Directories in [project-root]/src/main/resources get copied as expected, but not a single file gets created.

What do I miss?

Stephan Wissel

unread,
Jun 23, 2020, 2:56:03 PM6/23/20
to Jib users
Rookie mistake... solved after posting question
When running mvn compile jib:dockerBuild the build happens before the resources are copied into the target directory and don't get picked up by the build.
When running them in sequence it works as expected
mvn compile
mvn jib:dockerBuild 
In Automation I shall move the container build to a later build phase (e.g. post-compile)

Reply all
Reply to author
Forward
0 new messages