Alpine 里安装 docker

注,是实机安装 Alpine 作为主系统使用。

安装

apk add docker

添加开机自启

rc-update add docker boot

启动

service docker start

此时应该就可以正常使用 docker 了,可以执行 docker info 来检查看看

# docker info
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.10.4
Path: /usr/libexec/docker/cli-plugins/docker-buildx

Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 23.0.6
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
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 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 0cae528dd6cb557f7201036e9f43420650207b58
runc version: 860f061b76bb4fc671f0f9e900f7d80ff93d4eb7
init version:
Security Options:
seccomp
Profile: builtin
Kernel Version: 6.1.51-0-lts
Operating System: Alpine Linux v3.18
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 460.3MiB
Name: vultr
ID: 60556f53-c374-4131-8e9f-45c112f766b2
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
# docker version
Client:
Version: 23.0.6
API version: 1.42
Go version: go1.20.10
Git commit: ef23cbc4315ae76c744e02d687c09548ede461bd
Built: Thu Oct 12 14:14:03 2023
OS/Arch: linux/amd64
Context: default

Server:
Engine:
Version: 23.0.6
API version: 1.42 (minimum version 1.12)
Go version: go1.20.10
Git commit: 9dbdbd4b6d7681bd18c897a6ba0376073c2a72ff
Built: Thu Oct 12 14:14:03 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.7.2
GitCommit: 0cae528dd6cb557f7201036e9f43420650207b58
runc:
Version: 1.1.7
GitCommit: 860f061b76bb4fc671f0f9e900f7d80ff93d4eb7
docker-init:
Version: 0.19.0
GitCommit: