spotify / dockerfile-maven

MATURE: A set of Maven tools for dealing with Dockerfiles
Apache License 2.0
2.75k stars 493 forks source link

> > > I also encountered the same problem #345

Closed wxywizard closed 4 years ago

wxywizard commented 4 years ago

I also encountered the same problem

It seems that no one has maintained it, I suggest you use jib-maven-plugin.

谢谢,有没有demo参考下?

官方文档,这个插件跟dockerfile-plugin不同的是,它不需要本地安装docker环境,也不需要连接远程docker环境

            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>jib-maven-plugin</artifactId>
                <version>${jib-plugin-version}</version>
                <configuration>
                    <from>
                        <image>仓库地址/镜像:版本号</image>
                        <username>xxxx</username>
                        <password>xxxx</password>
                    </from>
                    <to>
                        <image>仓库地址/镜像:版本号</image>
                        <username>xxxx</username>
                        <password>xxxx</password>
                    </to>
                    <container>
                        <jvmFlags>
                            <jvmFlag>-Dspring.profiles.active=prod</jvmFlag>
                            <jvmFlag>-Xms512m</jvmFlag>
                            <jvmFlag>-Xdebug</jvmFlag>
                        </jvmFlags>
                        <ports>
                            <port>8080</port>
                        </ports>
                    </container>
                </configuration>
                <executions>
                    <execution>
                        <id>jib-maven-plugin</id>
                        <phase>package</phase>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Originally posted by @jiangyongbing24 in https://github.com/spotify/dockerfile-maven/issues/343#issuecomment-601085964

谢谢 但是我这么尝试他报错了

com.google.cloud.tools jib-maven-plugin 1.7.0 172.20.32.41:3272/hub.c.163.com/springcloud/java8 172.20.32.41:3272/sailing/${project.artifactId}:0.0.1 -Xms512m -Xdebug 7009 true jib-maven-plugin package build

错误信息 [ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:1.7.0:build (jib-maven-plugin) on project datademo: Tried to retrieve authentication method for 172.20.32.41:3272 but failed because: registry returned error code 404; possible causes include invalid or wrong reference. Actual error output follows: [ERROR] {"message":"page not found"}

jiangyongbing24 commented 4 years ago

I also encountered the same problem

It seems that no one has maintained it, I suggest you use jib-maven-plugin.

谢谢,有没有demo参考下?

官方文档,这个插件跟dockerfile-plugin不同的是,它不需要本地安装docker环境,也不需要连接远程docker环境

        <plugin>
            <groupId>com.google.cloud.tools</groupId>
            <artifactId>jib-maven-plugin</artifactId>
            <version>${jib-plugin-version}</version>
            <configuration>
                <from>
                    <image>仓库地址/镜像:版本号</image>
                    <username>xxxx</username>
                    <password>xxxx</password>
                </from>
                <to>
                    <image>仓库地址/镜像:版本号</image>
                    <username>xxxx</username>
                    <password>xxxx</password>
                </to>
                <container>
                    <jvmFlags>
                        <jvmFlag>-Dspring.profiles.active=prod</jvmFlag>
                        <jvmFlag>-Xms512m</jvmFlag>
                        <jvmFlag>-Xdebug</jvmFlag>
                    </jvmFlags>
                    <ports>
                        <port>8080</port>
                    </ports>
                </container>
            </configuration>
            <executions>
                <execution>
                    <id>jib-maven-plugin</id>
                    <phase>package</phase>
                    <goals>
                        <goal>build</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

Originally posted by @jiangyongbing24 in #343 (comment)

谢谢 但是我这么尝试他报错了

com.google.cloud.tools jib-maven-plugin 1.7.0

172.20.32.41:3272/hub.c.163.com/springcloud/java8

        </from>
        <to>
            <image>172.20.32.41:3272/sailing/${project.artifactId}:0.0.1</image>
        </to>
        <container>
            <jvmFlags>
                <jvmFlag>-Xms512m</jvmFlag>
                <jvmFlag>-Xdebug</jvmFlag>
            </jvmFlags>
            <ports>
                <port>7009</port>
            </ports>
        </container>
        <allowInsecureRegistries>true</allowInsecureRegistries> <!-- this is commented on the first run.-->
    </configuration>
    <executions>
        <execution>
            <id>jib-maven-plugin</id>
            <phase>package</phase>
            <goals>
                <goal>build</goal>
            </goals>
        </execution>
    </executions>
</plugin>

错误信息 [ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:1.7.0:build (jib-maven-plugin) on project datademo: Tried to retrieve authentication method for 172.20.32.41:3272 but failed because: registry returned error code 404; possible causes include invalid or wrong reference. Actual error output follows: [ERROR] {"message":"page not found"}

第一:你编辑的乱七八糟的,格式都乱了,但是这样我也感觉到你from配错了 第二:404错误是什么不用我多说了吧

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.