使用nexus建立php composer的私有仓库(docke

2022-12-12  本文已影响0人  天草二十六_简村人

一、nexus的环境变量(默认)

image.png

所以,我们一般会把NEXUS_DATA目录持久化,在这里,我们还需要对NEXUS_HOME目录也持久化。


image.png

二、上传bundle.kar文件

因为nexus-repository-composer-0.0.10-bundle.kar 文件是存放在目录/opt/nexus/deploy下。

[root@maven3 deploy]# pwd
/opt/nexus/deploy
[root@maven3 deploy]# ll
总用量 724
-rw-r--r-- 1 root root 737537 12月 13 17:42 nexus-repository-composer-0.0.10-bundle.kar

下载地址见:https://search.maven.org/artifact/org.sonatype.nexus.plugins/nexus-repository-composer/0.0.10/bundle

三、nexus的安装

修改docker-compose.yml内容,增加- /opt/nexus:/opt/sonatype/nexus:Z

version: '3'
services:
  nexus:
    restart: always
    image: sonatype/nexus3
    container_name: nexus3
    ports:
      - 8081:8081
      - 8082:8082
      - 8083:8083
      - 8084:8084
      - 8085:8085
    volumes:
      - /opt/nexus:/opt/sonatype/nexus:Z
      - /data/nexus-data:/nexus-data:Z

在重启前,稳妥起见先把容器里的目录拷贝到持久化目录。
docker cp 168ae2109cf8:/opt/sonatype/nexus/ /opt/nexus/
(其中168ae2109cf8为容器ID)

四、重启Nexus

在Bundles列表,可以看到你所安装的composer版本。

image.png

五、安装成功的效果

image.png

六、遇到的问题

2022-12-13 09:35:06,312+0000 ERROR [features-2-thread-1] *SYSTEM java.lang.Throwable - org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=nexus-repository-composer; type=karaf.feature; version="[0.0.29,0.0.29]"; filter:="(&(osgi.identity=nexus-repository-composer)(type=karaf.feature)(version>=0.0.29)(version<=0.0.29))" [caused by: Unable to resolve nexus-repository-composer/0.0.29: missing requirement [nexus-repository-composer/0.0.29] osgi.identity; osgi.identity=org.sonatype.nexus.plugins.nexus-repository-composer; type=osgi.bundle; version="[0.0.29,0.0.29]"; resolution:=mandatory [caused by: Unable to resolve org.sonatype.nexus.plugins.nexus-repository-composer [256](R 256.0): missing requirement [org.sonatype.nexus.plugins.nexus-repository-composer [256](R 256.0)] osgi.wiring.package; (&(osgi.wiring.package=com.fasterxml.jackson.core.type)(version>=2.13.0))]]

所以我把bundle的版本降低至0.0.10

上一篇 下一篇

猜你喜欢

热点阅读