1 安装docker-compose
$ curl -L "https://get.daocloud.io/docker/compose/releases/download/v1.25.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose
2 安装配置harbor
$ wget https://github.com/goharbor/harbor/releases/download/v2.6.1/harbor-offline-installer-v2.6.1.tgz
$ tar -zxvf harbor-offline-installer-v2.6.1.tgz
$ cd harbor
$ cp harbor.yml.tmpl harbor.yml
$ ./install.sh
停止harbor服务,在harbor目录下
$ docker-compose down
在后台启动harbor服务,在harbor目录下
$ docker-compose up -d
3 访问harbor
18.117.100.1:5000,新建springboot_demo项目
4 上传镜像
vi /etc/docker/daemon.json
{
"insecure-registries": ["18.117.175.71:5000"]
}
$ docker login http://18.117.175.71:5000
dockerfile生成的本地镜像
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
springboot_demo latest 9114f533abbd 30 hours ago 243MB
$ docker tag springboot_demo:latest 18.117.100.1:5000/springboot_demo/springboot_demo:1.0
$ docker push 18.117.100.1:5000/springboot_demo/springboot_demo:1.0
标签:compose,springboot,harbor,demo,--,docker,18.117
From: https://blog.csdn.net/hhujjj2005/article/details/139335970