How do I start an executable within an app deployed as a Docker container?

Hello everyone!
There is an ASP.NET Core Web API running on Fly in a container. The API has to invoke Protobuf compiler to generate .cs files (and use Roslyn next, but that’s the other story). And the problem is I catch an exception saying “Access denied” when this process is starting.
As the compiler I use pre-built Linux executable. I’ve tried to copy it from a web root path to a folder mounted to a volume, but no permission still.
This file isn’t deleted by Docker, and this approach works on my local machine (with .exe since I use Windows). I’m confused and don’t know where to start. Any help would be appreciated.

does your binary have the execute filesystem permission?

1 Like

Fly builders don’t package the container image with “Docker”, btw (as in there’s no cross platform virtualization). So, if you’re doing anything that requires Windows virtualization, I don’t think that would work on Fly (which runs the container on KVM’d amd64 Linux as-is). I may be wrong…

Can you share your dockerfile, if that’s okay?

Btw, Fly apps run as root user by default. And so, unless you change run-as user in the dockerfile, I’d imagine that there’s very little the app would get denied access to (stuff like, unavailable syscalls or capabilities or resources, say).

1 Like

Yup, that is the thing. I was a little confused by the fact that redeployment probably dropped my permissions before I move the executable to persistent storage. Rookie problems :slight_smile:
Thank you for your time!

1 Like

Thank you for educating me! Yes, you’re absolutely right about Windows virtualization - I face this fact, too, having some Windows-aimed modules.
There is no need in exposing dockerfile already since the problem was in permissions. Apparently, default access level for “random” executables restricts execution.

1 Like