Docker:如何避免Docker容器中不允许的操作? [英] Docker : How to avoid Operation not permitted in Docker Container?
问题描述
我通过备份所有必要的文件系统来创建了sles12计算机的一个docker映像,并创建了一个tar文件。为了创建docker镜像,我运行以下命令-
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
之后,我使用以下命令在容器中运行docker image-
After that I run docker image in container using below command -
docker run --net network1 -i -t sles_image /bin/bash
注意-我已经在此docker容器(我想要的IP地址)中建立了网络。
note - I already set up networking in this docker container (IP address which I want).
现在在我的docker容器,已经配置了一些应用程序,因为该应用程序在我创建该docker映像的sles12计算机中可用。这些自定义应用程序在内部运行一些内核底层命令,例如 modprobe 。
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?
推荐答案
您可以尝试设置具有运行时特权和Linux功能的Docker容器
docker run --privileged
docker run --privileged
这篇关于Docker:如何避免Docker容器中不允许的操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!