无法在Cloud9 IDE上运行docker

时间:2015-01-01 05:16:31

标签: docker cloud9-ide

我想让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你很烦,迫使我在没必要的时候写更多。

5 个答案:

答案 0 :(得分:13)

更新:以下答案适用于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)。

答案 1 :(得分:3)

我对第apt-get install docker行感到怀疑,因为这是其他一些码头工人。您可能希望根据http://docs.docker.com/installation/ubuntulinux/

尝试docker.iolxc-docker

答案 2 :(得分:3)

Cloud9 IDE(c9.io)不支持Docker,因为环境本身正在使用Docker。他们不希望用户离Docker根级环境太近。以下是有关不支持的Docker和其他软件的信息:Cloud9 Software they do not support list。我能够在c9.io上安装Docker,但是在尝试使用Docker稳定的回购安装方法时却抛出了错误;导致我来到这里。

有趣的是,Cloud 9的AWS Hosted版本确实允许更深入地使用Docker。不幸的是,这是单独的成本,并且是通过AWS与用户的接口……也许我会一起切换?这是AWS Cloud9 supporting Docker上的信息以及指向AWS landing page for cloud9的链接。

答案 3 :(得分:1)

Cloud9工作区在Docker容器中运行。他们不能在他们自己的docker容器中拥有docker容器,因为他们需要特权,这是一个安全风险。

此处有更多详情:https://community.c9.io/t/workspace-from-dockerfile-snapshots/34

答案 4 :(得分:0)

Cloud9环境预先安装了docker。检查者:docker --version。并查看此示例以获取更多信息:https://docs.aws.amazon.com/cloud9/latest/user-guide/sample-docker.html