gpt4 book ai didi

Docker Hello World 不工作

转载 作者:行者123 更新时间:2023-12-02 06:34:38 24 4
gpt4 key购买 nike

我正在尝试在我的 Linux Mint 上开始使用 Docker。我正在关注 Hello World 示例,但它似乎不起作用。这是我的日志:

# uname -a
Linux abenoit-linux 3.8.0-31-generic #46-Ubuntu SMP Tue Sep 10 20:03:44 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

# dpkg -l | grep docker
ii lxc-docker 0.9.0 amd64 Linux container runtime
ii lxc-docker-0.9.0 0.9.0 amd64 Linux container runtime

# docker info
Containers: 0
Images: 0
Driver: aufs
Root Dir: /var/lib/docker/aufs
Dirs: 0
WARNING: No memory limit support
WARNING: No swap limit support

# docker pull busybox
Pulling repository busybox
769b9341d937: Download complete
511136ea3c5a: Download complete
bf747efa0e2f: Download complete
48e5f45168b9: Download complete

# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
busybox latest 769b9341d937 6 weeks ago 2.489 MB

# docker run busybox /bin/echo hello world
#

我可以输入任何东西而不是“/bin/echo hello world”,但我从来没有得到任何输出(即使命令无效)。

知道这里出了什么问题吗?

最佳答案

刚刚发现问题:我在 Linux Mint 上,默认情况下未安装 cgroup-lite。并且在使用 apt-get install lxc-docker 时,仅建议而非必需:

# apt-get install lxc-docker
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
Les paquets supplémentaires suivants seront installés :
aufs-tools lxc-docker-0.9.0
Paquets suggérés :
cgroup-lite
Les NOUVEAUX paquets suivants seront installés :
aufs-tools lxc-docker lxc-docker-0.9.0

所以你必须手动安装它。

关于Docker Hello World 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22555264/

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