#Docker image contains unexpected commands

1 messages · Page 1 of 1 (latest)

pulsar marsh
#

Hello team. I'm building image in the following way:

image := w.client.Container().
        // We use this as a service base image because of an auth issue
        From("gcr.io/google.com/cloudsdktool/cloud-sdk:alpine").
        WithEnvVariable("PROJECT_ID", w.target.ProjectID).
        WithEnvVariable("PROJECT_NUMBER", w.target.ProjectNumber).
        WithEnvVariable("SERVICE_NAME", "intelligence").
        WithEnvVariable("COMMIT", w.target.SHA).
        WithEnvVariable("REGION", w.target.Region).
        WithEnvVariable("COUNTRY", w.target.Country).
        WithEnvVariable("SQL_USER", w.target.SQLUser).
        WithEnvVariable("SQL_PASSWORD", w.target.SQLPassword).
        WithEnvVariable("DATADOG_KEY", w.target.DatadogKey).
        WithEnvVariable("DATADOG_APP_KEY", w.target.DatadogAppKey).
        WithEnvVariable("SLACK_WEBHOOK_URL", w.target.SlackWebhookURL).
        WithEnvVariable("PORT", "8080").
        WithMountedFile("/tmp/mi5", runtime).
        Exec(dagger.ContainerExecOpts{
            Args: []string{"cp", "/tmp/mi5", "."},
        }).
        WithEntrypoint([]string{"./mi5"})

But if I inspect the result image, it has something that I didn't even pass (the Cmd array). Because of this, my runtime is getting redundant param ('/bin/sh') on execution.
Is this an expected behavior or a bug?

"Config": {
            ...
            "Env": [
                "PATH=/google-cloud-sdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                ...
                "PORT=8080"
            ],
            "Cmd": [
                "/bin/sh"
            ],
            ...
            "Entrypoint": [
                "/bin/mi5"
            ],
            ...
          },