JFrogContainerRegistry(JCR)部署及上传docker镜像测试

JFrog Container Registry (JCR) 是 JFrog 提供的一个完全托管的 Docker 容器镜像库解决方案,旨在存储、管理和分享 Docker 容器镜像和 Helm charts.

env

  • centos9.x
  • 基于二进制发型linux包

1.下载安装包

ad9f5c4796a6513a52df842953c27c79.png

1.1下载路径

2、启动软件

2.1解压

 tar zxf jfrog-artifactory-jcr-7.104.6-linux.tar.gz -C /opt/

[root@centos9-81 artifactory-jcr-7.104.6]# tree -L 2 .
.
├── app   应用目录
│   ├── access
│   ├── artifactory
│   ├── artifactory.product.version.properties
│   ├── bin
│   ├── doc
│   ├── event
│   ├── frontend
│   ├── metadata
│   ├── misc
│   ├── observability
│   ├── router
│   ├── third-party
│   └── topology
└── var   配置及变化文件存储
    ├── bootstrap
    └── etc

2.2启动服务

cd /opt/artifactory-jcr-7.104.6/app/bin
./artifactoryctl start

nohup java -jar artifactory.sh &
或者
nohup java -jar artifactoryctl & 

基于ctl脚本控制服务

[root@centos9-81 bin]# ./artifactoryctl --help

Usage: .//opt/artifactory-jcr-7.104.6/app/bin/artifactory.sh <action>

action: start|stop|restart|status|check|run|help

Note : If no action is passed, the services will be run in foreground.

内置jdk 21.0.5

cd /opt/artifactory-jcr-7.104.6/app/

[root@centos9-81 app]# ./third-party/java/bin/java --version
openjdk 21.0.5 2024-10-15 LTS
OpenJDK Runtime Environment Temurin-21.0.5+11 (build 21.0.5+11-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.5+11 (build 21.0.5+11-LTS, mixed mode, sharing)

3.访问jcr及新建仓库

3.1login

打开本地浏览器,访问serverIP:8081

默认账户密码:admin/password

勾选免费增值产品自动创建默认仓库
417f1f95d48a73776f5b2ad83856e086.png

ab28e8f5ee2140b38b0a593cee88fc3e.png

3.2新建仓库

3.3docker端配置daemon.json

vim /etc/docker/daemon.json

{
   "insecure-registries": 
     ["127.0.0.1:8081","10.24.101.99:8081"]
}


{
"insecure-registries":		 
   ["192.168.3.81:8082"],
"registry-mirrors":	 
    ["https://registry.docker-cn.com"],
"runtimes":{
  "nvidia":{
    "path": "nvidia-container-runtime",
    "runtimeArgs": []
    }
  }
} 

重启docker服务

systemctl restart docker

4.推送镜像

4.1拉取镜像
docker pull hello-world

4.2修改tag
docker tag docker.io/hello-world:latest 192.168.3.81:8082/opendatachain/hello-world:latest

4.3登录私有镜像仓库
docker login 192.168.3.81:8082

4.4推送镜像
docker push 192.168.3.81:8082/opendatachain/hello-world:latest

...
The push refers to repository [192.168.3.81:8082/opendatachain/hello-world]
f22b99068db9: Preparing 
f22b99068db9: Pushed 
latest: digest: sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 size: 525 

在jcr上刷新观察是否存在新推送镜像

4.5拉取镜像

[root@centos7 bin]# docker pull 192.168.3.81:8082/opendatachain/hello-world:latest
latest: Pulling from opendatachain/hello-world
b8dfde127a29: Pull complete 
Digest: sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792
Status: Downloaded newer image for 192.168.3.81:8082/opendatachain/hello-world:latest