Skip to content

/start shim is malformed with alpine image variants #3688

@TheCalypso

Description

@TheCalypso

Describe the problem

I just saw that there was an update to the stable-java21-alpine image. I just saw that my Docker images no longer start with the error in the Docker logs: sh: exec: line 0: /start: not found.

For context, I have a Bungeecord plugin that allows me to launch Docker however I want. Here is what I added as a script to the start of the container:

 public static List<String> generateStartupCommand() {
        return List.of("sh", "-c",
            "echo '===> Initialisation des configurations plugins'; " +
            "for dir in " + CONTAINER_CONFIG_PATH + "/*; do " +
            "  if [ -d \"$dir\" ]; then " +
            "    name=$(basename \"$dir\"); " +
            "    if [ ! -d \"" + CONTAINER_PLUGINS_PATH + "/$name\" ]; then " +
            "      echo \"===> Copie config plugin: $name\"; " +
            "      cp -r \"$dir\" \"" + CONTAINER_PLUGINS_PATH + "/$name\"; " +
            "    else " +
            "      echo \"===> Plugin $name déjà configuré, skip\"; " +
            "    fi; " +
            "  fi; " +
            "done; " +
            "echo '===> Démarrage du serveur Minecraft'; " +
            "exec /start");
    }

Could you tell me what I need to change? I point out that it worked very well before modifying the image a few minutes ago.

Container definition

    public static List<String> generateStartupCommand() {
        return List.of("sh", "-c",
            "echo '===> Initialisation des configurations plugins'; " +
            "for dir in " + CONTAINER_CONFIG_PATH + "/*; do " +
            "  if [ -d \"$dir\" ]; then " +
            "    name=$(basename \"$dir\"); " +
            "    if [ ! -d \"" + CONTAINER_PLUGINS_PATH + "/$name\" ]; then " +
            "      echo \"===> Copie config plugin: $name\"; " +
            "      cp -r \"$dir\" \"" + CONTAINER_PLUGINS_PATH + "/$name\"; " +
            "    else " +
            "      echo \"===> Plugin $name déjà configuré, skip\"; " +
            "    fi; " +
            "  fi; " +
            "done; " +
            "echo '===> Démarrage du serveur Minecraft'; " +
            "exec /start");
    }

Container logs

===> Initialisation des configurations plugins

===> Copie config plugin: GAPI

===> Copie config plugin: GaspeziaLoupGarou

===> Copie config plugin: ViaBackwards

===> Copie config plugin: ViaVersion

===> Copie config plugin: bStats

===> Copie config plugin: spark

===> Démarrage du serveur Minecraft

sh: exec: line 0: /start: not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions