Build CMD - executable not found

I have successfully built an image and if I go in through bash, I am able to execute “lua” from the command line.

Here is part of the build:

FROM debian:latest

RUN apt-get -y update && apt-get -y install lua5.1 lua-socket lua-sec

CMD [“lua”]

When I run the docker image, the error I keep getting is:

/bin/sh: 1: [“lua”]: not found

When I build it with:

CMD [“/usr/bin/lua”]

I then get this when I run it:

/bin/sh: 1: [“/usr/bin/lua”]: not found

What am I doing wrong?

I just tried your Dockerfile and it works as expected.
Since lua needs an interactive shell, I think you ran it wrong. Can you please try like this:

docker run -it <image-name> lua

Please replace the <image-name> with the
This will ensure you have an interactive shell.


I am actually not looking to have an interactive shell. There is a LUA script that should run after that, but I cannot even get LUA to execute. Interestingly enough, I did follow your instructions and did get lua to run properly.

My full CMD looks like this:

CMD [“lua”,“/etc/luascripts/luaScript.lua”]

When that runs I get:

/bin/sh: 1: [“lua”,”/etc/luascripts/luaScript.lua”]: not found