Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

[Question] How to push the docker image with different tags to multiple registries when deploying #392

Open
shink opened this issue Jan 30, 2022 · 1 comment

Comments

@shink
Copy link

shink commented Jan 30, 2022

Hi, there! Thank you for your contributions first!

I just have an question. How to push the docker image with different tags to multiple registries when deploying? I just want push it to Docker Hub and GitHub Container together.

Thank you very much.

@fishermans
Copy link

fishermans commented Feb 4, 2022

Hi @shink,

Without warranty (not tested): I guess you have to use multiple executable configurations within the executables tag of your plugin config. Move the configuration into each as usual.

            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>dockerfile-maven-plugin</artifactId>
                <version>1.14.13</version>
                <executions>
                    <execution>
                        <id>default</id>
                        <goals>
                            <goal>build</goal>
                            <goal>push</goal>
                        </goals>
                        <configuration>
                            <repository>spotify/foobar</repository>
                            <tag>${project.version}</tag>
                            <buildArgs>
                                <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
                            </buildArgs>
                        </configuration>
                    </execution>                    
                    <execution>
                        <id>second</id>
                        <goals>
                            <goal>build</goal>
                            <goal>push</goal>
                        </goals>
                        <phase>install</phase>
                        <configuration>
                            <repository>foo/bar</repository>
                            <tag>bar</tag>
                            <buildArgs>
                                <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
                            </buildArgs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants