eL_
eL_

Reputation: 177

Push docker image to Nexus

Hello I have Jenkins and Nexus on the same server. When Jenkins build project correctly, i want push image to Nexus 3, but every time i have the same problem (log below).

Configuration: pom.xml

<nexus.url>http://adress/#browse/browse/components:docker-image</nexus.url>

<distributionManagement>
   <snapshotRepository>
        <id>nexus</id>
        <url>${nexus.url}</url>
    </snapshotRepository>
</distributionManagement>
...
<plugins>
        <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.4</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>nexus</serverId>
              <nexusUrl>${nexus.url}</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
        </plugin>

And i have file settings.xml:

<servers>
 <server>
    <id>nexus</id>
    <username>login</username>
    <password>password</password>
 </server>
</servers>

Then i try "mvn clean deploy" and result is:

[INFO] Deploying remotely...
[INFO] Bulk deploying locally gathered artifacts from directory: 
[INFO]  * Bulk deploying locally gathered snapshot artifacts to URL http://adress/repository/image-docker/
Downloading: http://adress/repository/image-docker/someProject/0.1-SNAPSHOT/maven-metadata.xml
Uploading: http://adress/repository/image-docker/someProject/0.1-SNAPSHOT/someProject-0.1-20161213.093022-1.jar
Uploading: http://adress/repository/image-docker/someProject//0.1-SNAPSHOT/someProject-0.1-20161213.093022-1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:58 min
[INFO] Finished at: 2016-12-13T10:30:35+01:00
[INFO] Final Memory: 75M/748M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.4:deploy (injected-nexus-deploy) on project someProject: 
Failed to deploy artifacts: Could not transfer artifact someProject:jar:0.1-20161213.093022-1 from/to nexus (http://adress/repository/image-docker/):
Failed to transfer file: http://adress/repository/image-docker/someProject/someProject/0.1-SNAPSHOT/someProject-0.1-20161213.093022-1.jar. 
Return code is: 502, ReasonPhrase: Bad Gateway. -> [Help 1]

Every time is the same problem with 502 - Bad Gateway.

Do you have some proposal?

Upvotes: 0

Views: 7946

Answers (1)

DarthHater
DarthHater

Reputation: 3292

Unfortunately this will not work for a few reasons.

Hope this helps.

Upvotes: 2

Related Questions