Skip to content

Instead of CMD the ADD command gets executed! #3762

Closed
@mminke

Description

I have specified a CMD in a image and then used another Dockerfile to include that image and add some addition configuration.
Previously when I ran the docker run command for the new image, it rightly started the CMD defined exec. However, since my last build it does not execute the command anymore, but another command in the Dockerfile which in this case is actually the ADD command:
Here is part of the inspect data:

        "Cmd": [
            "/bin/sh",
            "-c",
            "#(nop) ADD file:147822c774f9b2b96afb9ad2cd36ffba318883f5f4be24eae3597b053d15995b in /opt/zikru/conf/zikru-config.properties"
        ],

If I execute docker history for the image I get:

006a5da11c91        2 days ago          /bin/sh -c #(nop) ENV ZIKRU_HOME=/opt/zikru     0 B
126ce758404e        2 days ago          /bin/sh -c #(nop) ADD file:ec10adccf5b585766d   12.84 MB
03617e7f5fc3        5 days ago          /bin/sh -c #(nop) ADD file:147822c774f9b2b96a   853 B
e2fce6a52c36        5 days ago          /bin/sh -c #(nop) MAINTAINER Morten Minke       0 B
aec6fe70ffb3        5 days ago          /bin/sh -c #(nop) CMD [/opt/apache-tomcat-7.0   0 B

There are more lines, but in the history the real command, to execute apache-tomcat, is defined but not executed. Instead one of the ADD commands (not sure about the logic on that one) is used as if it is the CMD!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions