Could you confirm what version of Nomad you are running and what operating system you are using? Do you have the logs handy also from when the agent starts the task?
I run nomad in a container as part of a devcontainer in vscode.
So far so good. Works well and the other Devs don’t have to think about how to install it and run it.
When nomad builds a task directories, it mounts a tmpfs as it’s running as root within the container.
I also need this as the docker driver requires root.
The trouble is that a tmpfs cannot be shared between containers. So the tmpfs that’s mounted by the nomad container is not mapped to the secret dir in the task container.
The task container gets a plain filesystem path based secret bind mount, which is empty. No .mount, no api.sock in this one.
So it’s pretty much checkmate in this configuration as root nomad triggers tmpfs.
I guess a good way to solve it would be to make it a config (tmpfs switch off for task local dirs), or simply avoid tmpfs in dev mode.