Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker : How to avoid Operation not permitted in Docker Container?

I created one docker image of sles12 machine by taking backing of all file system which are necessary and created one tar file. For creating docker image I run following command -

cat fullbackup.tar | docker import - sles_image

After that I run docker image in container using below command -

docker run --net network1 -i -t sles_image /bin/bash

note - I already set up networking in this docker container (IP address which I want).

Now In my docker container, some applications are already configured because that applications are available in sles12 machine from which I created this docker image. These custom applications are internally running some kernel low level commands like modprobe.

But when I starts my application, application will start correctly. I'm facing this error -

Operation not permitted

How I can give correct permissions so that it will not give me this error?

like image 722
ketan Avatar asked Dec 16 '16 06:12

ketan


People also ask

How do I force a Docker container to keep running?

Dockerfile Command to Keep the Container Running Method 1: You can use the -t (pseudo-tty) docker parameter to keep the container running.

How do I stop Docker containers from stopping?

According to this answer, adding the -t flag will prevent the container from exiting when running in the background. You can then use docker exec -i -t <image> /bin/bash to get into a shell prompt.

How can I override CMD when running a Docker image?

As the operator (the person running a container from the image), you can override that CMD just by specifying a new COMMAND. If the image also specifies an ENTRYPOINT then the CMD or COMMAND get appended as arguments to the ENTRYPOINT. So to do what you want you need only specify a cmd, and override using /bin/bash .


1 Answers

You might try set the Docker container with Runtime privilege and Linux capabilities, with the

docker run --privileged

like image 86
Miguel Ponce de Leon Avatar answered Oct 03 '22 15:10

Miguel Ponce de Leon