gpt4 book ai didi

docker - 无法在 Cloud9 IDE 上运行 docker

转载 作者:IT老高 更新时间:2023-10-28 12:43:54 26 4
gpt4 key购买 nike

我想让 Docker 在 Cloud9 IDE 上运行,但遇到了权限问题。有没有办法解决这个问题?

$ sudo apt-get install docker
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
docker
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 12.2 kB of archives.
After this operation, 65.5 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe docker amd64 1.5-1 [12.2 kB]
Fetched 12.2 kB in 0s (30.5 kB/s)
Selecting previously unselected package docker.
(Reading database ... 123844 files and directories currently installed.)
Preparing to unpack .../docker_1.5-1_amd64.deb ...
Unpacking docker (1.5-1) ...
Processing triggers for menu (2.1.46ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up cgroup-lite (1.9) ...
invoke-rc.d: unknown initscript, /etc/init.d/cgroup-lite not found.
dpkg: error processing package cgroup-lite (--configure):
subprocess installed post-installation script returned error exit status 100
Setting up docker (1.5-1) ...
Processing triggers for menu (2.1.46ubuntu1) ...
Errors were encountered while processing:
cgroup-lite
E: Sub-process /usr/bin/dpkg returned an error code (1)

$ sudo docker login
Username: <>
Password: <>
Email: <>
2015/01/01 05:11:28 Cannot connect to the Docker daemon. Is 'docker -d' running on this host?

$ sudo docker -d
2015/01/01 05:12:06 docker daemon: 1.0.1 990021a; execdriver: native; graphdriver:
[0c39ae0d] +job serveapi(unix:///var/run/docker.sock)
[0c39ae0d] +job initserver()
[0c39ae0d.initserver()] Creating server
2015/01/01 05:12:06 Listening for HTTP on unix (/var/run/docker.sock)
[0c39ae0d] +job init_networkdriver()
[0c39ae0d.init_networkdriver()] creating new bridge for docker0
operation not permitted
[0c39ae0d] -job init_networkdriver() = ERR (1)
operation not permitted
[0c39ae0d] -job initserver() = ERR (1)
2015/01/01 05:12:06 operation not permitted

$ sudo service docker start
docker: unrecognized service

Lorem ipsum stackoverflow 你很烦人,在不必要的时候强制我写更多。

最佳答案

更新:以下答案适用于 c9.io,不适用于 AWS Cloud9。 AWS Cloud9 允许您像往常一样在您用于环境的任何支持上运行 docker,无论是 EC2 还是其他 VM 提供商。


在 Cloud9 工作区中安装 Docker 将不起作用,因为 C9 工作区在 Docker 上运行。在 Docker 中运行 Docker 需要特殊权限,因此是 advised against by those who know best出于安全原因。

话虽如此,您可以从 SSH workspace 使用 Docker ,它允许您将 Cloud9 连接到您自己的服务器。由于该工作区未在 Docker 中运行(在 Cloud9 的服务器上),您可以使用它做任何您想做的事情(包括运行 Docker)。

关于docker - 无法在 Cloud9 IDE 上运行 docker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27728449/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com