首页  

docker Busybox 实战     所属分类 docker 浏览量 1491
Busybox集成了100多个最常用Linux命令,在单一的可执行文件中提供了精简的UNIX工具集。
Busybox是linux系统的瑞士军刀。

docker search busybox
INDEX       NAME                                  DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
docker.io   docker.io/busybox                     Busybox base image.                             1579      [OK]       
docker.io   docker.io/progrium/busybox                                                            69                   [OK]
docker.io   docker.io/hypriot/rpi-busybox-httpd   Raspberry Pi compatible Docker Image with ...   46                   


选star最多的官方镜像


docker search -s 1000 busybox
star超过1000的

docker pull docker.io/busybox 


docker run -it busybox

docker start 89494be9d297

docker ps 
CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                  NAMES
89494be9d297        busybox             "sh"                     About a minute ago   Up About a minute                          affectionate_visvesvaraya

进入容器 
docker exec -it 89494be9d297 sh

docker exec -it 89494be9d297 sh
Error response from daemon: Container 89494be9d2977e4a9ffe71324258967412baa7089c187e5168f67368d2d3a35a is not running


 
查看容器内的挂载信息 mount
查看容器的hostname和ip配置 cat /etc/hosts
查看容器默认的DNS服务器地址 cat /etc/resolv.conf

docker logs 89494be9d297


docker run --name busybox001 busybox  echo "hello,busybox"
hello,busybox

docker ps -l
CONTAINER ID        IMAGE               COMMAND                CREATED             STATUS                     PORTS               NAMES
9651e6391310        busybox             "echo hello,busybox"   4 seconds ago       Exited (0) 3 seconds ago                       busybox001



docker run -d  --name busybox003 busybox /bin/sh -c "while true; do echo hello world; sleep 1; done"
7cffea4a69bdcc4ee0484933440cee1352aa5441cda6f53c087114d63d588c6d

docker ps 
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                  NAMES
7cffea4a69bd        busybox             "/bin/sh -c 'while..."   7 seconds ago       Up 6 seconds                               busybox003

docker logs busybox003  -f

上一篇     下一篇
GC性能度量指标

ZGC简单介绍

docker常用命令

java调用c方法JNA实例

java堆外内存回收机制

ConcurrentHashMap在jdk7和8中的区别