fix: override the launcher for cnb apps since the default launcher is the process launcher...
This commit is contained in:
@@ -164,6 +164,7 @@ func executeScript(appName string, image string, imageTag string, phase string)
|
|||||||
|
|
||||||
common.LogInfo1(fmt.Sprintf("Executing %s task from %s: %s", phase, phaseSource, command))
|
common.LogInfo1(fmt.Sprintf("Executing %s task from %s: %s", phase, phaseSource, command))
|
||||||
isHerokuishImage := common.IsImageHerokuishBased(image, appName)
|
isHerokuishImage := common.IsImageHerokuishBased(image, appName)
|
||||||
|
isImageCnbBased := common.IsImageCnbBased(image)
|
||||||
dockerfileEntrypoint := ""
|
dockerfileEntrypoint := ""
|
||||||
dockerfileCommand := ""
|
dockerfileCommand := ""
|
||||||
if !isHerokuishImage {
|
if !isHerokuishImage {
|
||||||
@@ -224,6 +225,13 @@ func executeScript(appName string, image string, imageTag string, phase string)
|
|||||||
if os.Getenv("DOKKU_TRACE") != "" {
|
if os.Getenv("DOKKU_TRACE") != "" {
|
||||||
dockerArgs = append(dockerArgs, "--env", "DOKKU_TRACE="+os.Getenv("DOKKU_TRACE"))
|
dockerArgs = append(dockerArgs, "--env", "DOKKU_TRACE="+os.Getenv("DOKKU_TRACE"))
|
||||||
}
|
}
|
||||||
|
if isImageCnbBased {
|
||||||
|
// TODO: handle non-linux lifecycles
|
||||||
|
// Ideally we don't have to override this but `pack` injects the web process
|
||||||
|
// as the default entrypoint, so we need to specify the launcher so the script
|
||||||
|
// runs as expected
|
||||||
|
dockerArgs = append(dockerArgs, "--entrypoint=/cnb/lifecycle/launcher")
|
||||||
|
}
|
||||||
|
|
||||||
containerID, err := createdContainerID(appName, dockerArgs, image, script, phase)
|
containerID, err := createdContainerID(appName, dockerArgs, image, script, phase)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user