惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog
小众软件
小众软件
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】
爱范儿
爱范儿
博客园 - 聂微东
美团技术团队
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
有赞技术团队
有赞技术团队
云风的 BLOG
云风的 BLOG
罗磊的独立博客
V
Visual Studio Blog
WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
雷峰网
雷峰网
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
V
V2EX
The GitHub Blog
The GitHub Blog
Apple Machine Learning Research
Apple Machine Learning Research
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

kissthisrain

悲,OpenCodeGo套餐大砍 Token 用量小组件:适配 DeepSeek Harness 七月杂记 我是如何入住 InStreet 的:一个 AI Agent 的社交初体验 和OpenClaw聊着天,文章就发出去了 OpenClaw使用感受 Google Gemini体验 记笔记本开机不能自动联网的问题 关于我换掉2060S这件事:一些不成熟的显卡选购碎碎念 国庆后的第一个周末 记一次服务器负载过高的问题 职场搬迁新办公地 我的小狗 解决使用OpenVPN导致网络卡顿的问题 DICOM医学影像匿名化导致服务重启的问题 本地运行halo碰到的问题 Mybatis-Plus使用saveBatch方法不回显ID的问题 MongoDB语句(待补充) Java项目启动时间过长的问题 MySQL常用语句记录 windows常用命令记录 私有CI/CD平台搭建(一)Drone安装及部署
Alibaba Cloud Linux release 3安装Docker
kissthisrain · 2023-11-29 · via kissthisrain

1.前言

闲来无事整了一个阿里云服务器,第一步当然是先把Docker环境安装上,直接打开官方文档开整,官网地址:Install Docker Engine on CentOS | Docker Docs

主要针对Alibaba Cloud Linux 3的64位系统,其他环境的安装命令可能会有部分出入,仅供参考

2.开整

查询系统版本

服务器镜像选择的是阿里云的Alibaba Cloud Linux release 3系统,提供长达10年的支持和维护,关于该系统的描述可参考阿里云官方文档:什么是Alibaba Cloud Linux及其适用范围、费用、维护周期_云服务器 ECS-阿里云帮助中心 (aliyun.com)

lsb_release -a

显示信息如下

LSB Version: :core-4.1-amd64:core-4.1-noarch

Distributor ID: AlibabaCloud

Description: Alibaba Cloud Linux release 3 (Soaring Falcon)

Release: 3

Codename: SoaringFalcon


移除历史版本(第一次安装可忽略)

yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine

安装工具包

yum install -y yum-utils

设置镜像仓库,国内推荐使用阿里云镜像仓库地址

yum-config-manager \--add-repo \http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

刷新软件包索引

yum makecache

安装docker

顺便安装了docker-compose,直接安装最新版本(版本是24.0.7)

yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

查询docker版本

docker -v

当前时间(23年11月30号)使用的 最新的版本:Docker version 24.0.7


启动服务,并设置开机启动

systemctl start docker 
systemctl enable docker

查询服务运行状态

systemctl status docker

喜闻乐见的hello world环节

docker run hello-world

当出现以下输出时,恭喜安装成功

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/

3.结语

不积跬步无以至千里