我有一个全新的 Ubuntu 16.04 安装,只安装了 AMDGPU-Pro(专有)驱动程序和 docker-engine(来自 apt.dockerproject.org PPA)。
我想在 Docker 容器中运行 OpenCL 程序。我想:内核是共享的,所以 GPU 模块应该可用于容器,缺少的是访问模块的库。
我设置了一个容器并在其中编译了一个 OpenCL 程序。运行其中的程序返回未找到设备。所以我将二进制文件复制到主机,并在那里执行二进制文件(检测到我的两个 GPU 设备)。
我尝试创建一个新容器(来自 Ubuntu:16.04)并复制二进制文件,以及它从用于编译的容器中需要的所有库,以及/usr/lib/x86_64-linux-gnu/amdgpu-pro来自主机的文件夹。
不幸的是,这也不起作用。我可能会错过什么?
我正在 Ubuntu 16.04 上安装 docker。我正在遵循https://store.docker.com/editions/community/docker-ce-server-ubuntu?tab=description上的所有说明
(该说明在https://docs.docker.com/engine/installation/linux/ubuntu/ 上相同,但更清晰)。
当我启动步骤“2. Get Docker CE”时,它没有找到 docker-ce 包:
me@mypc:~$ sudo apt-get install docker-ce
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package docker-ce
Run Code Online (Sandbox Code Playgroud)
我已经检查并添加了回购。我已经更新了我的系统,但我没有得到这个包:
有谁知道这里有什么问题?
为什么容易切换docker从inactive到activeAWS上:
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo snap services
Snap Service Startup Current
docker dockerd enabled active
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo snap stop docker
Stopped.
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo snap services
Snap Service Startup Current
docker dockerd enabled inactive
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo snap start docker
Started.
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo snap services
Snap Service Startup Current
docker dockerd enabled active
ubuntu@ip-172-31-14-19:~$
Run Code Online (Sandbox Code Playgroud)
但在我的家庭系统上它仍然显示为inactive尽管使用 sudo?
thufir@dur:~$
thufir@dur:~$ sudo snap services
Snap Service Startup Current
docker dockerd enabled inactive …Run Code Online (Sandbox Code Playgroud) 我至少通过 snap 安装了 Spotify 和 docker。这两个都失败并显示相同的错误消息:
“无法对 init 进程的挂载命名空间文件描述符执行 readlinkat():权限被拒绝”。
其他一些快照应用程序对我有用。
我正在使用 18.04 并应用了所有更新。重新启动或重新安装都无法解决问题。重新安装快照本身也不会。
我不确定如何解决这个问题。
我正在使用ubuntu:16.04图像,但显然它没有hexdump包(因为我在图像中做的其他一些事情因此而失败)。所以,我试图apt-get install hexdump但得到一个错误E: Unable to locate package hexdump。
当我在网上搜索信息时,这个包似乎应该默认安装在 Ubuntu 上,但可能在 Docker 镜像中它被删除了。因此我无法真正找到如何安装它的来源。
据答案约泊坞窗这个问题,运行它作为一个非root是那么容易,因为添加的非root用户名到docker组,注销并回。果然,当我用它作为sudo对hello-world图像进展顺利。但是对于另一个名为whalefortune我的测试图像,我仍然收到access denied错误——见下文。
通常不再可以以非 root 用户身份运行 docker 了吗?我使用的是 Ubuntu 19.04,它比示例版本更新,并且有人提到可能存在以非 root 身份运行 docker 的安全漏洞。
我的想法是以普通用户身份运行 nvidia-docker,这可能吗(甚至是个好主意)?
$ sudo docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:6540fc08ee6e6b7b63468dc3317e3303aae178cb8a45ed3123180328bcc1d20f
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker …Run Code Online (Sandbox Code Playgroud) 我已经在我的ubuntu 机器上安装了 docker,它作为 service在后台运行。我现在如何访问docker 仪表板?有什么方法可以访问它。
我正在关注如何在 Docker 容器中运行 X11 应用程序的示例。我使用的是 Ubuntu 20.04 并使用 X11:
$ echo $XDG_SESSION_TYPE
x11
Run Code Online (Sandbox Code Playgroud)
我的Dockerfile:
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y x11-apps
ARG user=hakon
ARG home=/home/$user
RUN groupadd -g 1000 $user
RUN useradd -d $home -s /bin/bash -m $user -u 1000 -g 1000 \
&& echo $user:ubuntu | chpasswd \
&& adduser $user sudo
WORKDIR $home
USER $user
ENV HOME $home
COPY entrypoint.sh .
ENTRYPOINT ["./entrypoint.sh"]
Run Code Online (Sandbox Code Playgroud)
哪里entrypoint.sh:
echo "DISPLAY=$DISPLAY"
xclock # <-- …Run Code Online (Sandbox Code Playgroud) 按照一些教程安装 docker 后,例如这个:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04
我尝试启动 docker 服务,它说它正在尝试启动(systemctl 东西对我不起作用,因为我得到了System has not been booted with systemd as init system):
$ sudo service docker start
* Starting Docker: docker
Run Code Online (Sandbox Code Playgroud)
但它在运行时永远不会如图所示启动
$ sudo service docker status
* Docker is not running
Run Code Online (Sandbox Code Playgroud) Canonical 博客提到了 Ubuntu Minimal Docker 镜像:https://canonical.com/blog/minimal-ubuntu-released。当我搜索 Docker Hub 时,Ubuntu Minimal我发现10,000 results for Ubuntu Minimal第二个似乎是普通的 Ubuntu: https: //hub.docker.com/_/ubuntu。我没有看到任何minimal名称或标签。Ubuntu Minimal Docker 镜像在哪里?