日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

docker linux 快速开窗口_Linux搭建docker环境并简单实用

發布時間:2025/3/8 linux 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 docker linux 快速开窗口_Linux搭建docker环境并简单实用 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

記錄生活:

配置阿里云鏡像源docker YUM

[root@centos-linux ~]# sudo yum install -y yum-utils device-mapper-persistent-data lvm2

[root@centos-linux ~]# sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

安裝 Docker-CE

[root@centos-linux ~]# sudo yum install docker-ce

啟動docker

# 開機自啟

[root@centos-linux ~]# sudo systemctl enable docker

# 啟動docker服務

[root@centos-linux ~]# sudo systemctl start docker

查看版本

[root@centos-linux ~]# docker -v

Docker version 19.03.8, build afacb8b

查看詳情

[root@centos-linux ~]# docker version

Client: Docker Engine - Community

Version: 19.03.8

API version: 1.40

Go version: go1.12.17

Git commit: afacb8b

Built: Wed Mar 11 01:27:04 2020

OS/Arch: linux/amd64

Experimental: false

Server: Docker Engine - Community

Engine:

Version: 19.03.8

API version: 1.40 (minimum version 1.12)

Go version: go1.12.17

Git commit: afacb8b

Built: Wed Mar 11 01:25:42 2020

OS/Arch: linux/amd64

Experimental: false

containerd:

Version: 1.2.13

GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429

runc:

Version: 1.0.0-rc10

GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd

docker-init:

Version: 0.18.0

GitCommit: fec3683

[root@centos-linux ~]# docker info

Client:

Debug Mode: false

Server:

Containers: 0

Running: 0

Paused: 0

Stopped: 0

Images: 0

Server Version: 19.03.8

Storage Driver: overlay2

Backing Filesystem:

Supports d_type: true

Native Overlay Diff: true

Logging Driver: json-file

Cgroup Driver: cgroupfs

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: runc

Default Runtime: runc

Init Binary: docker-init

containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429

runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd

init version: fec3683

Security Options:

seccomp

Profile: default

Kernel Version: 3.10.0-1062.el7.x86_64

Operating System: CentOS Linux 7 (Core)

OSType: linux

Architecture: x86_64

CPUs: 2

Total Memory: 482.4MiB

Name: centos-linux.shared

ID: DFEQ:IXET:QELN:7ZA6:BM6D:5ENE:2TEN:Y3MD:BVOG:KM54:CTAS:IUK4

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

Live Restore Enabled: false

下載centos鏡像,測試

[root@centos-linux ~]# docker pull centos

查看列表

[root@centos-linux ~]# docker images

運行容器,當出現root@《一串數字》表示進入

[root@centos-linux ~]# docker run -it centos /bin/bash

[root@7f32d43c7e53 /]# ls

bin dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv sys tmp usr var

退出容器

exit

查看所有的容器信息, 能獲取容器的id

[root@centos-linux ~]# docker ps -a

docker commit -m=“備注” 你的CONTAINER_ID 你的IMAGE

請自行將 -m 后面的信息改成自己的容器的信息

以及刪除容器命令rmi

[root@centos-linux ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

7f32d43c7e53 centos "/bin/bash" 2 minutes ago Exited (0) 27 seconds ago sharp_cohen

[root@centos-linux ~]# docker commit -m='lious' 7f32d43c7e53 centos

sha256:8d75dd2b1d0150decc7c82bc0d3ca467856fefb5c4ec20d4b35f03f61fc7faab

[root@centos-linux ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

7f32d43c7e53 470671670cac "/bin/bash" 3 minutes ago Exited (0) About a minute ago sharp_cohen

[root@centos-linux ~]# docker commit -m='lious' 7f32d43c7e53 liousdeimage

sha256:0131fbbdfe2c5589a77356f77406f349c6aa7c3275835a7cdfd94be2a2d2b256

[root@centos-linux ~]# ls

anaconda-ks.cfg original-ks.cfg redis-4.0.2 redis-4.0.2.tar.gz

[root@centos-linux ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

7f32d43c7e53 470671670cac "/bin/bash" 5 minutes ago Exited (0) 3 minutes ago sharp_cohen

[root@centos-linux ~]# docker commit -m='備注' 7f32d43c7e53 470671670cac

sha256:c003336be27108c9c2485ae43b02587b224d02b4a3ac79c7f46227bc22c6bc4d

[root@centos-linux ~]# docker images

REPOSITORY TAG IMAGE ID CREATED SIZE

470671670cac latest c003336be271 13 seconds ago 237MB

liousdeimage latest 0131fbbdfe2c About a minute ago 237MB

centos latest 8d75dd2b1d01 3 minutes ago 237MB

centos 470671670cac 3 months ago 237MB

[root@centos-linux ~]# docker rmi 470671670cac:latest

Untagged: 470671670cac:latest

Deleted: sha256:c003336be27108c9c2485ae43b02587b224d02b4a3ac79c7f46227bc22c6bc4d

[root@centos-linux ~]# docker images

REPOSITORY TAG IMAGE ID CREATED SIZE

liousdeimage latest 0131fbbdfe2c 2 minutes ago 237MB

centos latest 8d75dd2b1d01 4 minutes ago 237MB

centos 470671670cac 3 months ago 237MB

總結

以上是生活随笔為你收集整理的docker linux 快速开窗口_Linux搭建docker环境并简单实用的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。