我正在尝试使用命令“spring-boot:build-image”而不使用 Dockerfile 在 Gitlab-ci.yaml (管道)中构建 Spring Boot 应用程序的 docker 映像。该命令在终端开发工作站上运行良好。但是 Gitlab 的 CI/CD Pipeline 抛出了错误。如果有人可以提供帮助,请不胜感激。
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.6.4:build-image (default-cli) on project buildpackdemo: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.6.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]
Run Code Online (Sandbox Code Playgroud)
maven-build:
image: maven:3-jdk-11
stage: build
script:
- "mvn spring-boot:build-image"
artifacts:
paths:
- target/*.jar
Run Code Online (Sandbox Code Playgroud)