slimtoolkit / slim

Slim(toolkit): Don't change anything in your container image and minify it by up to 30x (and for compiled languages even more) making it secure too! (free and open source)
Apache License 2.0
19.5k stars 732 forks source link

build show message "no ENTRYPOINT/CMD" #704

Open icewizardry opened 3 months ago

icewizardry commented 3 months ago

20220407PWEA:/tmp$ slim build --target xprobe/xinference:v0.14.0 --tag xprobe/xinference:v0.14.0-slim cmd=build info=param.http.probe message='using default probe' cmd=build state=started cmd=build info=params tags='xprobe/xinference:v0.14.0-slim' image-build-engine='internal' target.type='image' target.image='xprobe/xinference:v0.14.0' continue.mode='probe' rt.as.user='true' keep.perms='true' cmd=build state=image.inspection.start cmd=build info=image id='sha256:ef25a8c0d302bdbf03f14926e561ca6d6cfede82383cad85d3fc978ae95bc983' size.bytes='15526677283' size.human='16 GB' cmd=build info=image.stack name='xprobe/xinference:v0.14.0' id='sha256:ef25a8c0d302bdbf03f14926e561ca6d6cfede82383cad85d3fc978ae95bc983' index='0' cmd=build state=image.inspection.done cmd=build state=container.inspection.start cmd=build info=target.image.error status='no.entrypoint.cmd' image='xprobe/xinference:v0.14.0' message='no ENTRYPOINT/CMD' cmd=build state=exited code=33554438 cmd=build info=report file='slim.report.json' cmd=build info=exit version='linux/amd64|Transformer|1.40.11|1b271555882eacdfb4e6598d6d0552e9b9b1449b|2024-02-02_01:36:22PM' location='/usr/local/bin' code='33554438'

kcq commented 3 months ago

@icewizardry the container image you are targeting, xprobe/xinference:v0.14.0, has no entrypoint or cmd information, so the container can't start on its own without explicitly specifying what needs to execute inside of the container.

If you run docker inspect xprobe/xinference:v0.14.0 you will see that in the "Config" section "Cmd" is null and "Entrypoint" is null. It appears that the image was created with the ENTRYPOINT [] instruction, which reset the container startup information.

To deal with container images like that you need to specify the entrypoint and/or cmd info using the --entrypoint and --cmd flags.