4

I'm trying to do the following within a Docker container:

docker run -it <image> bash
root$ dd if=/dev/zero of=file.fs bs=1024 count=1024
root$ mkfs.ext4 file.fs
root$ mkdir tmp
root$ mount -t ext4 file.fs tmp
**mount: tmp/: mount failed: Unknown error -1**
root$ dmesg
dmesg: read kernel buffer failed: Operation not permitted

The same commands above (with sudo) work fine on my host.

How can I get mount to succeed within the Docker container?

1 Answer 1

5

If permission error, you need add --privileged

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.