微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在我的 Docker 映像上构建 Spring Native 应用程序

如何解决在我的 Docker 映像上构建 Spring Native 应用程序

我正在 alpine (openjdk:13-alpine) docker 映像上构建我的 spring boot 本机 应用程序。

./mvnw spring-boot:build-image -DskipTests

执行此操作时出现错误

[INFO] Building image 'docker.io/library/bff-distributor:0.0.1-SNAPSHOT'
[INFO] 
[INFO] I/O exception (java.io.IOException) caught when processing request to {}->docker://localhost:2376: com.sun.jna.LastErrorException: [2] No such file or directory
[INFO] retrying request to {}->docker://localhost:2376
[INFO] I/O exception (java.io.IOException) caught when processing request to {}->docker://localhost:2376: com.sun.jna.LastErrorException: [2] No such file or directory
[INFO] retrying request to {}->docker://localhost:2376
[INFO] I/O exception (java.io.IOException) caught when processing request to {}->docker://localhost:2376: com.sun.jna.LastErrorException: [2] No such file or directory
[INFO] retrying request to {}->docker://localhost:2376
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 100%
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:54 min
[INFO] Finished at: 2021-04-16T15:26:34Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.4:build-image (default-cli) on project bff-distributor: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.4.4:build-image Failed: Connection to the Docker daemon at 'localhost' Failed with error "[2] No such file or directory"; ensure the Docker daemon is running and accessible: com.sun.jna.LastErrorException: [2] No such file or directory -> [Help 1]

我的 gitlab.ci 配置

build:
  image: openjdk:13-alpine
  stage: build
  script:
    - chmod 755 ./mvnw
    - ./mvnw spring-boot:build-image -DskipTests

有关信息:我需要它在 docker 映像上运行,因为它是我的 gitlab ci/cd 阶段的一部分。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。