How to install Docker on CentOS 7
Centos中安装Docker, 参考:
https://www.linuxtechi.com/install-docker-on-centos-7/
How to install Nexus Repository Manager 3 with Docker:
https://github.com/sonatype/docker-nexus3
https://help.sonatype.com/display/NXRM3/Installation#Installation-InstallingwithDocker
A. docker Pull Command
- docker pull sonatype/nexus3
B. Persistent Data
There are two general approaches to handling persistent storage requirements with Docker. See Managing Data in Containers for additional information.
- Use a data volume. Since data volumes are persistent until no containers use them, a volume can be created specifically for this purpose. This is the recommended approach.
$ docker volume create --name nexus-data
$ docker run -d -p 8081:8081 --name nexus -v nexus-data:/nexus-data sonatype/nexus3
2. To test.
/]# curl -u admin:admin123 http://localhost:8081/service/metrics/ping
pong
说明成功!
Docker容器启动
$ systemctl start docker
$ systemctl enable docker
$ systemctl stop docker
$ systemctl status docker
nexus的启动:
$ docker start nexus
$ docker stop nexus
$ docker stats nexus
$ docker rm nexus(删除image)
查看Docker中image
$ docker ps -a