Docker私有仓库实例
C:\Users\think\.m2\settings.xml文件配置: <?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://maven.kjt.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
<servers>
<server>
<id>releases</id>
<username>p_user</username>
<password>p_password</password>
</server>
<server>
<id>snapshots</id>
<username>p_user</username>
<password>p_password</password>
</server>
<server>
<id>docker-hub</id>
<username>p_password</username>
<password>p_password</password>
<configuration>
<email>docker@xxx.com</email>
</configuration>
</server>
</servers>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<releases.repo>http://maven.kjt.com/nexus/content/repositories/releases</releases.repo>
<snapshots.repo>http://maven.kjt.com/nexus/content/repositories/snapshots</snapshots.repo>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>com.backportal</groupId>
<artifactId>backportal</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging> <name>com.backportal</name>
<description>Demo project for Spring Boot</description> <parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
<!-- 布局功能的支持程序 thymeleaf3主程序 layout2以上版本 -->
<!-- thymeleaf2 layout1-->
<thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
<docker.repostory>docker.xxx.com</docker.repostory>
<docker.dockerhost>http://192.168.xx.xx:xxxx</docker.dockerhost>
<docker.registry.name>x_project/xxx</docker.registry.name>
</properties> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<!-- 引入web模块 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<artifactId>spring-boot-starter-logging</artifactId>
<groupId>org.springframework.boot</groupId>
</exclusion>
</exclusions>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.1</version>
</dependency> <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<!--引入jquery-webjar-->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.3.1</version>
</dependency> <!--引入bootstrap-->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>4.0.0</version>
</dependency>
<!--引入阿里druid连接池监控-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.8</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.8.0-beta2</version>
</dependency>
</dependencies> <build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>${project.artifactId}</finalName>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<executions>
<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>push-image</id>
<phase>deploy</phase>
<goals>
<goal>push</goal>
</goals>
<configuration>
<imageName>${docker.repostory}/${docker.registry.name}:${project.version}</imageName>
</configuration>
</execution>
</executions>
<configuration>
<serverId>docker-hub</serverId>
<registryUrl>https://${docker.repostory}</registryUrl>
<dockerHost>${docker.dockerhost}</dockerHost>
<dockerDirectory>${project.basedir}</dockerDirectory>
<pushImage>true</pushImage>
<imageName>
${docker.repostory}/${docker.registry.name}:${project.version}
</imageName>
<imageTags>
<imageTag>latest</imageTag>
</imageTags>
<resources>
<resource>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</project>
Dockerfile文件设置 FROM java:8-jre
MAINTAINER windMan <wen.chao@kjt.com>
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone ADD ./target/backportal.jar /app/
CMD ["java", "-Duser.timezone=GMT+8", "-jar", "/app/backportal.jar"] EXPOSE 外部暴露端口(注意:外部端口不可以重复,内部端口和外部端口可以重复)
Docker私有仓库实例的更多相关文章
- 搭建docker私有仓库,建立k8s集群
服务器IP角色分布 192.168.5.2 etcd server 192.168.5.2 kubernetes master 192.168.5.3 kubernetes node 192.168. ...
- Docker私有仓库与Harbor部署使用
Docker私有仓库与Harbor部署使用 目录 Docker私有仓库与Harbor部署使用 一.本地私有仓库 1. 下载registry镜像 2. 在daemon.json文件中添加私有镜像仓库地址 ...
- 一步步搭建docker私有仓库并从私有仓库中下载镜像
一步步搭建docker私有仓库 #下载镜像 docker pull registry#查看镜像 docker images #运行私有仓库,指定端口和数据卷 docker run -d -p : -v ...
- docker 私有仓库镜像的存储位置
docker 私有仓库的镜像 是存储在5739360d1030 registry "docker-registry" 3 days ago Up 28 hours 0.0.0.0: ...
- 在docker私有仓库如何查看有哪些镜像?
搭建了docker私有仓库,上传了一些镜像,时间长了就会忘了有哪些镜像,在网上查了,有大佬是通过脚本查看的,多厉害! #!/usr/bin/env python#-*- coding:utf-8 -* ...
- 转载:教你分分钟搞定Docker私有仓库Registry
一.什么是Docker私有仓库Registry 官方的Docker hub是一个用于管理公共镜像的好地方,我们可以在上面找到我们想要的镜像,也可以把我们自己的镜像推送上去.但是,有时候我们的服务器无法 ...
- Docker 私有仓库建立(加密和用户验证)
(一)生成证书1.mkdir /certs2.cd /certs 3.生成自签名证书 sudo openssl req -newkey rsa:2048 -new -nodes -x509 -days ...
- 搭建docker私有仓库(https)
1.修改openssl.cnf,支持IP地址方式,HTTPS访问在Redhat7或者Centos系统中,文件所在位置是/etc/pki/tls/openssl.cnf.在其中的[ v3_ca]部分,添 ...
- 搭建docker私有仓库
保存镜像的地方成为仓库(registry).目前有2种仓库:公共仓库和私有仓库. 最方便的是使用公共仓库上传和下载镜像,下载不需要注册,上传需要到公共仓库注册.公共仓库网站:https://hub.d ...
随机推荐
- Load data local infile 实验报告
1.实验内容: 利用SQL语句“load data local infile”将“pet.txt”文本文件中的数据导入到mysql中 (pet表在数据库menagerie中) 2.实验过程及结果: ( ...
- WdatePicker 日期区间设置
<input id="billsStartDate" name="billsStartDate" onclick="WdatePicker({d ...
- SHA256withRSA证书签名,私钥签名/公钥验签
证书签名 package test; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundE ...
- 大佬是怎么思考设计MySQL优化方案的?
在进行MySQL的优化之前,必须要了解的就是MySQL的查询过程,很多查询优化工作实际上就是遵循一些原则,让MySQL的优化器能够按照预想的合理方式运行而已. 一.优化的哲学 注:优化有风险,涉足需谨 ...
- input框输入金额显示千分位
比如输入:1000000,则显示为1,000,000(或者是保留3位小数:1,000,000.000) 知识点: 1)JavaScript parseFloat() 函数: 定义:parseFloat ...
- 安全检查,Windows更新出现8024402F错误如何解决
背景,每个月都要进行例行检查,需要更新windows补丁包,病毒库等操作,谁知今天windows报错了: windows 代码8024402f 错误,原因是更新日志和缓冲出了问题. 解决步骤 : 1. ...
- 第二课丶pygame
学号:2017*****1024 姓名:王劲松 我的码云贪吃蛇项目仓库:https://gitee.com/Danieljs/sesnake 分析游戏中的备注和问题:10分钟 游戏名称.分数改动:3分 ...
- js去除数组里重复的条目,返回被删除的条目的新数组
我爱撸码,撸码使我感到快乐! 大家好,我是Counter. 今天给大家分享的是利用js进行数组的去重,还是老样子,该注释的都注释在代码里了 欢迎一起技术探讨,一起成长. 效果如下: 代码给出: // ...
- CF932G Palindrome Partition
思路 首先把字符串变为\(S[1]S[n]s[2]s[n-1] \dots\) 这样原来的一个合法的划分方案就变成了用k个长度为偶数的回文子串划分的方案, 然后直接DP,对i位置,可转移的位置就是它的 ...
- UVA12206 Stammering Aliens
思路 可以二分答案+哈希 判断有没有那个长为L的串出现至少m次即可 代码 #include <cstdio> #include <cstring> #include <a ...