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

Multiple builds lead to exponential growth of target/ #544

Closed
adamish opened this issue Jan 24, 2021 · 3 comments
Closed

Multiple builds lead to exponential growth of target/ #544

adamish opened this issue Jan 24, 2021 · 3 comments
Labels
bug Something isn't working Waiting on feedback Issues that require feedback from User/Other community members

Comments

@adamish
Copy link

adamish commented Jan 24, 2021

Description

I'm using jKube maven plugin in external "Dockerfile" as such. I've found that multiple builds quickly fill the disk.

I've traced this fundamental feature of the default plugin configuration

The plugin creates a tar of the contents of /target/, and then places that at target/docker//latest/tmp/docker-build.tar. This is then fed to Docker, and left in place...
A subsequent build then takes the entire contents of target/ (including the tar) file, and puts it in the tar file...

544K	target/ # build 1
1.3M	target/ # build 2
2.8M	target/ # build 3
5.8M	target/ # build 4
12M	target/ # build 5

The file structure in target/ also appears to become more deeply nested after each build

./target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/tmp/docker-build.tar

./target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/tmp/docker-build.tar

./target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/tmp/docker-build.tar

./target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/tmp/docker-build.tar

./target/docker/my-image-name/latest/build/maven/target/docker/my-image-name/latest/tmp/docker-build.tar

./target/docker/my-image-name/latest/tmp/docker-build.tar

I've repeated this with a very simple configuration

<plugin>
    <groupId>org.eclipse.jkube</groupId>
    <artifactId>kubernetes-maven-plugin</artifactId>
    <configuration>
        <images>
            <image>
                <name>my-image-name:%l</name>
                <build>
                    <dockerFile>${project.basedir}/Dockerfile</dockerFile>
                </build>
            </image>
        </images>
    </configuration>
</plugin>

Info

  • Eclipse JKube version : 1.0.2
  • Maven version 3.6.3
@manusa manusa added the bug Something isn't working label Jan 25, 2021
@manusa
Copy link
Member

manusa commented Jan 25, 2021

Hi @adamish
Thank you for reporting.
Yes, we're aware of this issue, it has to do with the contextDir and assembly configuration are inferred when using only the Dockerfile config.

You can currently work around this issue by configuring your project in any of the ways described in this example docker-file-provided.

@manusa
Copy link
Member

manusa commented Jan 25, 2021

Relates to #529

@manusa
Copy link
Member

manusa commented Apr 8, 2021

This issue should have been addressed in the latest release (1.2.0).

Could you please confirm if you are still facing this?

@manusa manusa added the Waiting on feedback Issues that require feedback from User/Other community members label Apr 8, 2021
@manusa manusa closed this as completed Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Waiting on feedback Issues that require feedback from User/Other community members
Projects
None yet
Development

No branches or pull requests

2 participants