2016-12-13 4 views
0

안녕하세요 저는 젠킨스와 넥서스가 같은 서버에 있습니다. Jenkins가 프로젝트를 올바르게 만들면 이미지를 Nexus 3에 푸시해야하지만 동일한 문제가 발생할 때마다 (아래 로그 참조)Nexus에 도커 이미지 푸시

구성 : 의 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> 

그리고 내가 settings.xml 파일이 : 내가 "MVN 깨끗한 배포"시도하고 그 결과 다음

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

은 다음과 같습니다

[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] 

때마다 502 - Bad Gateway와 동일한 문제가 발생합니다.

몇 가지 제안이 있으십니까?

답변

2

불행히도 이것은 몇 가지 이유로 작동하지 않습니다.

희망이 있습니다.

+0

1. 예, 권리가 있습니다. 어제 나는 http : // adress/repository/image-docker /에 대한 url을 변경했고 여전히 문제가있다. 2. 플러그인에 문제가있는 것 같지만, 도커 이미지를 메이븐 저장소 Nexus에 푸시하고 싶습니다. 하지만 좋아, 나는 Docker Maven 플러그인을 사용해 보았다. –

+0

Docker 이미지를 Maven 저장소로 푸시 할 수 없다고 생각합니다 (필자가 필자가 틀리게 나를 증명할 것이기 때문에 생각합니다). 그렇게하려면 Docker에서 호스팅하는 저장소를 사용하는 것이 좋습니다. – DarthHater

+0

네, 여기에 넥서스를 사용하고 싶습니다 : https://www.ivankrizsan.se/2016/06/09/create-a-private-docker-registry/ –