sudo docker run --rm -it --mount type=bind,source="./wrapper",target="/wrapper" alpine ls -al /wrapper && /wrapper
Executes:
sudo docker run --rm -it --mount type=bind,source="./wrapper",target="/wrapper" alpine ls -al /wrapper
which finishes successfully, so the shell that you are typing the commands into then executes another completely separate unrelated to docker command:
/wrapper
If you want to execute it in docker pass it all to docker. &&
in shell chains the commands.
docker run --rm -it --mount type=bind,source="./wrapper",target="/wrapper" alpine sh -c 'ls -al /wrapper && /wrapper'
Consider researching an introduction to shell scripting and command chaining and quoting in particular.
Additionally, note, that you are running alpine linux. The binary is incompatible with musl C standard library and can't be run with alpine. Consider re-evaluating what exactly are you doing and researching what is alpine linux and how it differs, what is musl and how it differs from glibc, why bringing binary from host into docker is a bad idea, and consider just installing gcc into the image inside.
What am I doing incorrectly?
You are assuming shared library compatibility between your host system and a docker container. The whole idea of docker is to provide a layer of separation, so you don't have to deal with library compatibility. Consider using only binaries compiled specifically for the libraries inside the container - i.e. install and build them inside the container only and do not bring them from the host system.
The "why on alpine linux I get not found" error has been asked on this forum countless times. See Docker Alpine executable binary not found even if in PATH