https://docs.docker.com/get-started/
安装docker
1、安装docker
apt install docker
2、配置docker加速器
安装完成后在 /etc/docker下新建文件daemon.json文件
编辑文件,添加国内镜像(官方Docker Hub比较慢)
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
"registry-mirrors": ["https://registry.docker-cn.com"]
}
3、更新daemon.json文件,并重启docker
systemctl daemon-reload
systemctl restart docker
4、拉取hello-world镜像
docker pull hello-world
5、创建hello-world容器并运行,测试是否安装成功
docker run hello-world
创建dockerfile
from jdk --基础镜像
add helloworld.jar --添加jar包
8001:8001--映射端口
java -jar --启动jar包
将镜像push到Harbor