# week16 **Repository Path**: pet-admin_admin/week16 ## Basic Information - **Project Name**: week16 - **Description**: No description available - **Primary Language**: Java - **License**: 0BSD - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-23 - **Last Updated**: 2021-06-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # week16 #### 介绍 将 Spring Boot 应用打包 Java Native 应用,再将该应用通过 Dockerfile 构建 Docker 镜像,部署到 Docker 容器中,并且 成功运行, Spring Boot 应用的实现复杂度不做要求 #### 编译 执行 ./mvnw package -Pnative -DskipTests 经过漫长的等待,在target 目录生成对应的native可执行文件 #### docker image 生成 执行 docker build -t spring-boot-native/demo ./ #### 本地运行镜像 执行 docker run -t spring-boot-native/demo -p 8001:8001 #### 验证 请求http://localhost:8001/helloworld,浏览器回显 hello spring boot native