1.yum install docker
centos以上直接下載docker.
2.下載jenkins包蜜暑,創(chuàng)建啟動(dòng)jenkins容器即供,下載jenkins插件
docker run -d --name jenkins -p 49001:8080 -v /home/jenkins_home:/home/jenkins_home jenkins/jenkins:lts
49001端口映射容器的8080端口捣染,首次進(jìn)入需要password瞬场,進(jìn)入容器 docker exec -it containerId /bin/bash
3.部署spring boot項(xiàng)目?
修改pom文件
添加DockerFile
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ADD spring-boot-docker-1.0.jar app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]