转载

voidlinux安装dockerV20.10.11


安装voidlinux

更新root密码

sudo passwd root

更新清华source

        mkdir -p /etc/xbps.d
        cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
        sed -i 's|https://alpha.de.repo.voidlinux.org|https://mirrors.tuna.tsinghua.edu.cn/voidlinux|g' /etc/xbps.d/*-repository-*.conf
        #sed -i 's|https://mirrors.tuna.tsinghua.edu.cn/voidlinux|https://alpha.de.repo.voidlinux.org|g' /etc/xbps.d/*-repository-*.conf
        update-ca-certificates
        SSL_NO_VERIFY_PEER=1 xbps-install -Sv -y
        SSL_NO_VERIFY_PEER=1 xbps-install -u xbps -y
        SSL_NO_VERIFY_PEER=1 xbps-install -uv -y
        SSL_NO_VERIFY_PEER=1 xbps-install curl -y
        SSL_NO_VERIFY_PEER=1 xbps-install neofetch -y

重启

reboot

查看系统信息

bash-5.1# uname -a
Linux 10 5.13.19_1 #1 SMP Sat Sep 18 18:18:26 UTC 2021 x86_64 GNU/Linux
bash-5.1# neofetch
                __.;=====;.__                   root@10 
            _.=+==++=++=+=+===;.                ------- 
             -=+++=+===+=+=+++++=_              OS: Void Linux x86_64 
        .     -=:``     `--==+=++==.            Host: VirtualBox 1.2 
       _vi,    `            --+=++++:           Kernel: 5.13.19_1 
      .uvnvi.       _._       -==+==+.          Uptime: 47 secs 
     .vvnvnI`    .;==|==;.     :|=||=|.         Packages: 164 (xbps-query) 
+QmQQmpvvnv; _yYsyQQWUUQQQm #QmQ#:QQQWUV$QQm.   Shell: sh 
 -QQWQWpvvowZ?.wQQQE==<QWWQ/QWQW.QQWW(: jQWQE   Resolution: 1024x768 
  -$QQQQmmU'  jQQQ@+=<QWQQ)mQQQ.mQQQC+;jWQQ@'   CPU: Intel i5-7300HQ (2) @ 2.495GHz 
   -$WQ8YnI:   QWQQwgQQWV`mWQQ.jQWQQgyyWW@!     GPU: VirtualBox Graphics Adapter 
     -1vvnvv.     `~+++`        ++|+++          Memory: 56MiB / 3932MiB 
      +vnvnnv,                 `-|===
       +vnvnvns.           .      :=-                                   
        -Invnvvnsi..___..=sv=.     `                                    
          +Invnvnvnnnnnnnnvvnn;.
            ~|Invnvnvvnvvvnnv}+`
               -~|{*l}*|~

安装docker

xbps-install inetutils iptables xz libseccomp git jq -y
curl -fsSL https://cdn.jsdelivr.net/gh/dyrnq/install-docker@main/install-docker.sh | bash -s docker --mirror opentuna --version 20.10.11 --prefix /usr/bin --no-systemd
mkdir -p /etc/sv/docker && \
curl -fsSL -o /etc/sv/docker/run https://ghproxy.com/https://github.com/void-linux/void-packages/raw/master/srcpkgs/moby/files/docker/run && \
chmod +x /etc/sv/docker/run && \
ln -s /etc/sv/docker /var/service/ && \
usermod -aG docker vagrant

由于voidlinux的pid1不是systemd而是runit,所以这里需要做额外的处理

bash-5.1# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete 
Digest: sha256:cc15c5b292d8525effc0f89cb299f1804f3a725c8d05e158653a563f15e4f685
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 client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

bash-5.1# docker info
Client:
 Context:    default
 Debug Mode: false

Server:
 Containers: 1
  Running: 0
  Paused: 0
  Stopped: 1
 Images: 1
 Server Version: 20.10.11
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc version: v1.0.2-0-g52b36a2d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.13.19_1
 Operating System: void
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.84GiB
 Name: 10
 ID: AHUK:2JXX:4UK5:6GDK:XCZS:7GVF:OEIQ:BOJQ:TQG3:RALH:FNOF:BZL2
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Registry Mirrors:
  https://docker.mirrors.ustc.edu.cn/
 Live Restore Enabled: true
 Product License: Community Engine

{{o.name}}
{{m.name}}
  • 转载自:https://my.oschina.net/dyrnq/blog/5324891
  • 留言