1.创建dockerfile  新建Dockerfile文件

FROM openjdk:8-jdk-alpine
VOLUME /tmp
ADD springbootdemo-2.0-SNAPSHOT-exec.jar app.jar
RUN sh -c 'touch /app.jar'
ENV JAVA_OPTS=""
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/.urandom -jar /app.jar"]

2.build docker image

docker build -t springbootdemo . 

dcoker build springboot

3.查看dockerimages。  执行:docker images

dcoker build springboot

4.启动dockerimage。 执行:docker run -d -p 8080:8088 e1767d3745d7(image id)

dcoker build springboot

5.查看正在运行的docker image 。执行:docker ps ,docker ps -a

dcoker build springboot

6.停止docker 。执行:docker stop ea79bd83562bb048b93cdfbccc2918fae0cce81fdfebe82be2eb4b09a793ae11(容器ID)

dcoker build springboot

 

相关文章:

  • 2022-12-23
  • 2022-01-21
  • 2021-09-21
  • 2021-07-27
  • 2022-01-12
  • 2021-10-09
  • 2022-01-07
  • 2021-07-18
猜你喜欢
  • 2022-12-23
  • 2021-09-13
  • 2022-03-02
  • 2021-12-16
  • 2021-06-08
  • 2021-06-16
  • 2021-08-10
相关资源
相似解决方案