0

I'm hitting an error in a docker container, that seems to be related to the host running the docker container.

I'm unable to use taskset to run an executable, in an Ubuntu docker container hosted on Docker Desktop for Windows 10, with Ubuntu wsl 2 backend. I do not see this issue in for the exact same container being run on an Ubuntu virtual machine, on my Windows host.

Over a few hours of scouring the web, I came across this WSL issue (which I think is related only based on a hunch and because it's unresolved and gives me something to point my finger at)

https://github.com/microsoft/WSL/issues/4286

More specifically, I have an executable that needs to be run with the following commands:

sudo setcap all=ep ./MyExecutable.exe
taskset -c 2 ./MyExecutable.exe

But the taskset command results in the error

taskset: failed to execute ./MyExecutable: Operation not permitted

I am able to run the executable if I give it different capabilities with setcap, but... I actually do need it to be all=ep.

This led me down the rabbit hole of eventually needing to run this command:

sudo sysctl -w kernel.yama.ptrace_scope=0

However, that is met with this error:

sysctl: cannot stat /proc/sys/kernel/yama/ptrace_scope: No such file or directory

Which was met with the recommendation that I touch the non-existent ptrace_scope file. At which time I discovered I don't have the folder /proc/sys/kernel/yama, so I try to create that folder but am denied:

sudo su
cd /proc/sys/kernel
mkdir yama

Which is met with the error (again, as root, which is weird)

mkdir: cannot create directory 'yama': No such file or directory

Other things I've tried include editing the contents of /etc/sysctl.conf and/or ensuring that /etc/sysctl.d/10-ptrace.conf has the line kernel.yama.ptrace_scope = 0 (which it does). And various combinations and permutations of updating/uninstalling/rebooting docker desktop, wsl, the container in question, rebooting my Windows host machine. etc.

No luck so far.

Ryan Franz
  • 133
  • 5

0 Answers0