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

Defining multiple buildx.cacheFrom #1822

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

Defining multiple buildx.cacheFrom #1822

ggjulio opened this issue Sep 17, 2024 · 0 comments

Comments

@ggjulio
Copy link

ggjulio commented Sep 17, 2024

Description

I'm trying to setup a shared cache using cache-from and cache-to on a repo.

The docker doc says that we can use multiple caches.

But with the plugin I did not found a way to declare more that one cacheFrom for buildx.
Is it possible to do so ?

<!-- [...] redacted -->
<buildx>
	<platforms>
	     <platform>${docker.platforms}</platform>
	</platforms>
	<cacheTo>type=registry,ref=${docker.cache.registry}/my-image:${git.branch}</cacheTo>
	<cacheFrom>type=registry,ref=${docker.cache.registry}/my-image:${git.branch}</cacheFrom>
	<!-- the last cacheFrom overrides the first definition -->
	<cacheFrom>type=registry,ref=${docker.cache.registry}/my-image:master</cacheFrom>
</buildx>
<!-- [...] redacted  -->

Similarly to docker.cacheFrom.idx I also tried declaring a property list docker.buildx.cacheFrom.idx:

<buildx>
	<platforms>
	     <platform>${docker.platforms}</platform>
	</platforms>
	<cacheTo>type=registry,ref=${docker.cache.registry}/my-image:${git.branch}</cacheTo>
       <!-- Prop list does not work for buildx cachefrom
       Unable to parse configuration of mojo io.fabric8:docker-maven-plugin:0.45.0:build for parameter cacheFrom.1: Cannot find  'cacheFrom.1' in class io.fabric8.maven.docker.config.BuildXConfiguration  -->
	<cacheFrom.1>type=registry,ref=${docker.cache.registry}/my-image:${git.branch}</cacheFrom.1>
	<cacheFrom.2>type=registry,ref=${docker.cache.registry}/my-image:master</cacheFrom.2>
</buildx>
@ggjulio ggjulio changed the title Defining multiple buildx.cacheFrom options Defining multiple buildx.cacheFrom Sep 18, 2024
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