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

Add property to skip buildx cacheto #1827

Open
ggjulio opened this issue Sep 30, 2024 · 0 comments
Open

Add property to skip buildx cacheto #1827

ggjulio opened this issue Sep 30, 2024 · 0 comments

Comments

@ggjulio
Copy link

ggjulio commented Sep 30, 2024

I would like to enable or disable cache-to based on whether or not the build run in the CI or a developer workspace.
Did not found a easy way to do so.

Is adding a new property the right approach ?

Via Property :

$> mvn install --docker.skip.cacheTo=false
$>  mvn install --docker.skip.cacheTo=true

Via element :

<property>
   <myProp>false</myProp>
</property>

<!-- ... redacted -->
    <buildx>
	    <platforms>
	         <platform>${docker.platforms}</platform>
	    </platforms>
            <skipCacheTo>${myProp}</skipCacheTo>
	    <cacheTo>type=registry,ref=${docker.cache.registry}/my-image:${git.branch}</cacheTo>
	    <cacheFrom>type=registry,ref=${docker.cache.registry}/my-image:${git.branch}</cacheFrom>
    
    </buildx>
 <!-- ... redacted -->
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

1 participant