实用 docker history

关闭安装认证, 开启tcp 端口

sudo vi /usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd --insecure-registry regdev.harbor.com -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
sudo systemctl daemon-reload;sudo systemctl restart docker;

docker pull regdev.harbor.com/aliyun/centos:7.2.1511

docker images

docker history regdev.harbor.com/aliyun/centos:7.2.1511

docker rm $(docker ps -a -q)

docker ps

docker stop tomcat-deploy-ms

docker start tomcat-deploy-ms

docker port tomcat-deploy-ms
发现 tomcat-deploy-ms 并没有占用端口

docker run --name deploy-ms -d -p 8888:8080 regdev.harbor.com/daocloud/tomcat:7.0.85
lsof -i:8888
netstat -nltp
sudo lsof -i:8888

连接到正在运行中的容器, 可以看到 stdout

docker attach deploy-ms
退出bash, ctrl p, 然后 ctrl q

进入正在运行容器并以命令行交互

docker exec -it deploy-ms /bin/sh

直接以交互的方式运行

docker run -it
-v /home/lcpubsudo/workspace/finance-cloud-turbine_dev/:/opt/
regdev.harbor.com/aliyun/centos:7.2.1511
/bin/bash

docker commit -m "install jdk" -a "sscf" -p efe8ff6c5a67 centos-jdk:7.2.1511

docker build -t regdev.harbor.com/library/alpine-jre:0 .

docker login regdev.harbor.com
admin
Harbor12345

docker push regdev.harbor.com/aliyun/centos:7.2.1511

posted @ 2020-02-27 10:53  Casaa  阅读(249)  评论(0编辑  收藏  举报