harbor搭建和登录,参考链接
https://blog.csdn.net/sun007700/article/details/88221507
拉取tomcat镜像并推到harbor。
docker pull tomcat
docker login test.com
docker tag tomcat:latest test.com/sunsy/basic-tomcat
docker push test.com/sunsy/basic-tomcat
#tomcat后面要跟上tag或者image id,如果忘记了,可以使用命令docker images查看
#test.com是Harbor仓库地址,sunsy是Harbor仓库下的项目名称
#basic-tomcat是推到项目上,该镜像的镜像名
1、开始构建镜像
先要登录到harbor上,才有权限
docker login test.com
写dockerfile
FROM docker.io/tomcat:latest
MAINTAINER crj
RUN rm -rf /usr/local/tomcat/webapps/*
ADD target/*.war /usr/local/tomcat/webapps/ROOT.war
# docker build -t test.com/sunsy/tomcat-java-demo .
6、开始推到harbor上
docker push 192.168.1.25/project/php-demo
7、登录harbor 192.168.1.25查看