1.卸载
sudo yum remove docker-ce
$ sudo rm -rf /var/lib/docker
$ sudo yum remove docker
docker-client
docker-client-latest
docker-common
docker-latest
docker-latest-logrotate
docker-logrotate
docker-engine
2.安装
$ sudo yum install -y yum-utils
device-mapper-persistent-data
lvm2
3.升级
yum -y upgrade
java 配置docker插件
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- Docker maven plugin -->
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</build>
<!-- Docker maven plugin -->
</plugins>
</build>
Dockerfile 配置
FROM daocloud.io/library/java:openjdk-8u40
VOLUME /tmp
ADD datav-eureka-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
EXPOSE 8761
FROM centos
MAINTAINER yaolin
COPY jdk1.7.0_79 jdk1.7.0_79
ADD websocket.jar app.jar
ENV JAVA_HOME=/jdk1.7.0_79
ENV PATH=$JAVA_HOME/bin:$PATH
ENV CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/app.jar"]