mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
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))
|
||||
isHerokuishImage := common.IsImageHerokuishBased(image, appName)
|
||||
isImageCnbBased := common.IsImageCnbBased(image)
|
||||
dockerfileEntrypoint := ""
|
||||
dockerfileCommand := ""
|
||||
if !isHerokuishImage {
|
||||
@@ -224,6 +225,13 @@ func executeScript(appName string, image string, imageTag string, phase string)
|
||||
if 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)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user