标签:work 自动 restart nexus3 shell cat exe word ted
mkdir -p /usr/local/docker/nexus
cat > /usr/local/docker/nexus/docker-compose.yml<<‘EOF‘
version: ‘3.1‘
services:
nexus:
# 镜像名称
image: ‘sonatype/nexus3‘
# 容器名字 docker run --name
container_name: nexus
# 开机自动重启
restart: always
# 端口映射
ports:
- ‘8081:8081‘
volumes:
- nexus-data:/nexus-data
volumes:
nexus-data:
EOF
cd /usr/local/docker/nexus
docker-compose up -d
[root@SaaS nexus]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
400f24b1c02f sonatype/nexus3 "sh -c ${SONATYPE_DI…" 48 minutes ago Up 45 minutes 0.0.0.0:8081->8081/tcp
# docker交互
docker exec -it 400f24b1c02f /bin/bash
bash-4.4$ cd /opt/sonatype/sonatype-work/nexus3/
bash-4.4$ cat admin.password
209dc63c-7c9a-4def-92ae-ded41a3b5ec4bash-4.4$
标签:work 自动 restart nexus3 shell cat exe word ted
原文地址:https://www.cnblogs.com/leoshi/p/12745537.html