Create alpine container that runs executable in volume directory?

Is it possible to run a alpine image to run an executable that is inside a volume without creating a new image? In Podman Desktop, I placed the following values in these fields when running the alpine image into a new container.

Command

/bin/sh -c /server/application

Volumes

~/Documents/server-data:/server

Ports

8080:8080

However I always get this error in my container logs. I think it could be due to the fact the container does not have permission to execute /server/application?

/bin/sh: /server/application: not found

2 points · 4 comments · view on lemmy.world

4 Comments

xnasero@programming.dev · 1 pts · 2y

You can test your theory, if you run

touch foo <
xnasero@programming.dev · 1 pts · 2y
touch foo <<\EOF
#!/bin/sh
echo hello world
\EOF
./foo
xnasero@programming.dev · 1 pts · 2y

You can test your theory run this

touch foo <
xnasero@programming.dev · 1 pts · 2y

You can test your theory if you run

touch foo <