Skip to content

Permission denied on alpine #6

@muellerj

Description

@muellerj

I was trying to get the self-hosted server running Alpine 3.19 to work but ran into problems when accessing the temporary files from the docker image:

/srv/codapi # cat bin/test
#!/bin/sh

curl \
  -H "content-type: application/json" \
  -d '{ "sandbox": "sh", "command": "run", "files": {"": "echo hello" }}' \
  http://localhost:1313/v1/exec
/srv/codapi # bin/test | jq
{
  "id": "sh_run_b3a94e77",
  "ok": false,
  "duration": 416,
  "stdout": "",
  "stderr": "sh: can't open 'main.sh': Permission denied\n (exit status 2)"
}

The logs look similar:

/var/lib/codapi # tail -n2 /var/log/codapi/openrc.log 
2024/01/15 22:23:50 [run --rm --name sh_run_b3a94e77 --runtime runc --cpus 1 --memory 64m --network none --pids-limit 64 --user sandbox --read-only --volume /tmp/1851081613:/sandbox:ro --cap-drop all --ulimit nofile=96 codapi/alpine sh main.sh]
2024/01/15 22:23:50 ✗ sh_run_b3a94e77: sh: can't open 'main.sh': Permission denied (exit status 2)

The folder /tmp has the usual permissions.

I've documented my setup [here][1]. Is there something I've misconfigured?

Thanks for your help in advance!

[1]: https://git.tigger.cloud/public/codapi-setup-alpine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions