Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use docker to build nexus and configure docker private repository

2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

* * Nexus is used for Maven private server, but it is found on the official website that the latest Nexus 3.x also supports Docker repository, so use docker to build Nexus

Find Mirror

Docker search nexus

To select and use more times is to pull the mirror image.

Docker pull sonatype/nexus3

View the pulled image

Docker images

Start the container

Docker run-d-- name nexus3-- restart=always-p 8081 sonatype/nexus3 8081 sonatype/nexus3

We need to wait a few minutes.

Login configuration

Ensure that you use a browser to access the http:// server ip:8081 after normal startup

Click on the upper right corner to log in to the account password: admin/admin123 or enter the address as prompted

After logging in, click the settings interface to select Repositories, and click Create repository, as shown in the figure.

Select the warehouse type here select the hosted type as shown in the figure

Configure the warehouse

The repository specifies a unique name, port of HTTP, API that allows interaction, etc.

Connect the warehouse

Other machines need to be connected to the warehouse to perform push, pull and other operations.

Vim / etc/docker/daemon.json needs to be configured before connecting to the warehouse

Other machines need to be connected to the warehouse to perform push, pull and other operations.

Vim / etc/docker/daemon.json needs to be configured before connecting to the warehouse

{

"insecure-registries": ["192.168.1.10 purl 8082"]

}

Systemctl daemon-reloadsystemctl restart docker

Configure realms (login,pull,push cannot be performed without this item)

Log into the warehouse

Docker login-u admin-p admin123 192.168.1.10 admin123 8082 # Note the port here is the port number selected when configuring the repository

Upload image

Docker tag nginx:latest 192.168.1.10:8082/nginx:0.1

Docker push 192.168.1.10:8082/nginx:0.1

Pull the image

Docker pull 192.168.1.10:8082/nginx:0.1

Search for an image

Docker search 192.168.1.10 8082 Unix *

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report