ERROR: failed to launch: determine start command: when there is no default process a command is required

这一生的挚爱 提交于 2020-12-15 01:04:06

问题


After upgrading spring boot to 2.4 we cannot run the final docker image that we create via this script:

script:
    - echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
    - apk add openjdk11
    - ./gradlew bootBuildImage --imageName=$DOCKER_IMAGE_INTERMEDIATE
    - docker build -f ./docker/Dockerfile --build-arg base_image=$DOCKER_IMAGE_INTERMEDIATE -t $DOCKER_IMAGE_TAGGED .
    - docker push $DOCKER_IMAGE_TAGGED
    - docker tag $DOCKER_IMAGE_TAGGED $DOCKER_IMAGE_LATEST
    - docker push $DOCKER_IMAGE_LATEST

our Dockerfile just creates a folder and chowns it to the CNB user:

# The base_image holds a reference to the image created by ./gradlew bootBuildImage
ARG base_image
FROM ${base_image}

ENV SOME_PATH /var/lib/some/files

USER root

RUN mkdir -p ${SOME_PATH}

RUN chown ${CNB_USER_ID}:${CNB_GROUP_ID} ${SOME_PATH}

USER ${CNB_USER_ID}:${CNB_GROUP_ID}

ENTRYPOINT /cnb/lifecycle/launcher

While this worked fine in spring boot 2.3, we now get this error after upgrading to spring boot 2.4 when trying to run the image:

ERROR: failed to launch: determine start command: when there is no default process a command is required

Edit:

The CI log output shows this line at the end of the bootBuildImage command:

[creator]     Setting default process type 'web'

Edit2:

By further inspecting the differences of the images created by bootBuildImage with spring-boot 2.3 and 2.4 I found a hint that the default ENTRYPOINT no longer is /cnb/lifecycle/launcher but /cnb/process/web.

Updating the last line of our Dockerfile to select this entrypoint:

ENTRYPOINT /cnb/process/web

enables us to start the image! yay! :)

However, I leave the question open, because I still wonder why the default process is no longer used by the lifecycle launcher?!

来源:https://stackoverflow.com/questions/65013814/error-failed-to-launch-determine-start-command-when-there-is-no-default-proce

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!