Menu

Dipesh Majumdar

Blog and Paintings

Finding out Entrypoint, CMD, env of docker from the image

Million Dollar Question: You have an image - but you wan to find out the entry point from the image. How will you do that? Well you need the Dockerfile to know entrypoint right? But if you dont have it right now how will you find out these informations - env, entrypoint, cmd?

[dipesh.majumdar@demo ~]$ docker inspect busybox |grep -A100 -i \"Config\"
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "Cmd": [
                "sh"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:90b7037cc5e65fa9e3f33e8096febd6fad8af0ff94876d73dabe048d65bec645",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": null
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 1199417,
        "VirtualSize": 1199417,
        "GraphDriver": {
            "Name": "overlay2",
            "Data": {
                "MergedDir": "/var/lib/docker/overlay2/c6026745fff5b1608f900c1415df5ec03cb3f97cdb54e831e636b35fa7f18548/merged",
                "UpperDir": "/var/lib/docker/overlay2/c6026745fff5b1608f900c1415df5ec03cb3f97cdb54e831e636b35fa7f18548/diff",
                "WorkDir": "/var/lib/docker/overlay2/c6026745fff5b1608f900c1415df5ec03cb3f97cdb54e831e636b35fa7f18548/work"
            }
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:0b97b1c81a3200e9eeb87f17a5d25a50791a16fa08fc41eb94ad15f26516ccea"
            ]
        }
    }
]

 

Go Back

Comment