Skip to content

ls: Operation not permitted, docker CE 24.0.2 #4333

@sputnick-dev

Description

@sputnick-dev

Description

I have a Debian 11 image from debian:latest, I can build it as a charm.

But when I by example try as root to ls /tmp, I get:

# ls /tmp
ls: cannot access '/tmp': Operation not permitted

It's not only /tmp. I can ls only my current directory.

I searched another bug reports and the web, most of the time people try to upgrade docker and libseccomp2 (I have 2.5.1-1). I tried to get Debian sid packages, but it require to upgrade libc6 that is not a solution if I don"t want to break all my system. Any clue?

Reproduce

#!/bin/bash
docker run -d \
     --device=/dev/net/tun --cap-add=NET_ADMIN \
     -v /home/me/.config:/home/me/.config \
     -v /home/me/repository:/home/me/repository \
     -w $PWD \
     -e PVPN_USERNAME=xxx \
     -e PVPN_PASSWORD=xxx \
     --security-opt seccomp=$PWD/chrome.json \
     -v /etc/localtime:/etc/localtime:rw \
     --add-host="mongodb:172.17.0.1" \
     --user root --hostname container container

id=$(docker ps | awk '$2=="container"{print $1}')
docker container rename $id container
docker exec -u user -it container bash

Expected behavior

To be able to do by example:

ls /tmp

docker version

Client: Docker Engine - Community
 Version:           24.0.2
 API version:       1.43
 Go version:        go1.20.4
 Git commit:        cb74dfc
 Built:             Thu May 25 21:52:17 2023
 OS/Arch:           linux/amd64
 Context:           default

docker info

Client: Docker Engine - Community
 Version:    24.0.2
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.5
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
WARNING: Plugin "/usr/libexec/docker/cli-plugins/docker-compose" is not valid: failed to fetch metadata: exit status 1

Server:
 Containers: 1
  Running: 1

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions