使用阿里云ecs服务器学习docker

简介: ecs服务器docker

使用阿里ecs服务器初学docker,记载了部分笔记。
镜像(image):
Docker安装
基本组成
docker镜像好比是一个模板,可以通过模板来创建容器服务

容器(container):

docker利用容器技术,独立运行一个或者一组应用

仓库(repository):

存放镜像的地方,分为公有仓库和私有仓库

Docker Hub,默认国外仓库,国内需要配置镜像加速

1.2 安装Docker
Install Docker Engine on Ubuntu | Docker Documentation

切换到root用户

docker version

Client: Docker Engine - Community
Version: 20.10.8
API version: 1.41
Go version: go1.16.6
Git commit: 3967b7d
Built: Fri Jul 30 19:54:27 2021
OS/Arch: linux/amd64
Context: default
Experimental: true

Server: Docker Engine - Community
Engine:
Version: 20.10.8
API version: 1.41 (minimum version 1.12)
Go version: go1.16.6
Git commit: 75249d8
Built: Fri Jul 30 19:52:33 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.9
GitCommit: e25210fe30a0a703442421b0f60afac609f950a3
runc:
Version: 1.0.1
GitCommit: v1.0.1-0-g4144b63
docker-init:
Version: 0.19.0
GitCommit: de40ad0
测试hello-world

docker run hello-world

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:393b81f0ea5a98a7335d7ad44be96fe76ca8eb2eaa76950eb8c989ebf2b78ec0
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/

查看已安装的镜像

docker images

配置阿里云镜像加速
sudo mkdir -p /etc/docker

sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["阿里镜像加速地址*"]
}
EOF

sudo systemctl daemon-reload

sudo systemctl restart docker

相关实践学习
使用操作系统智能助手OS Copilot解锁操作系统运维与编程
在本实验场景中,将在阿里云ECS上体验OS Copilot产品。OS Copilot是阿里云操作系统团队基于大模型构建的OS智能助手。它具有自然语言问答、辅助命令执行、系统运维调优等功能,帮助用户更好地使用Linux,提升阿里云的使用体验。
7天玩转云服务器
云服务器ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,可降低 IT 成本,提升运维效率。本课程手把手带你了解ECS、掌握基本操作、动手实操快照管理、镜像管理等。了解产品详情:&nbsp;https://www.aliyun.com/product/ecs
相关文章
|
6月前
|
弹性计算 搜索推荐 异构计算
阿里云服务器多少钱一年?亲自整理ECS、轻量和GPU服务器租赁价格表
2025年阿里云服务器优惠汇总:轻量应用服务器2核2G 38元/年起,ECS 2核2G 99元/年,2核4G 199元/年,4核16G 89元/月,8核32G 160元/月,香港轻量25元/月起,新老用户同享,续费同价。
1696 158
|
6月前
|
运维 安全 Ubuntu
阿里云渠道商:服务器操作系统怎么选?
阿里云提供丰富操作系统镜像,涵盖Windows与主流Linux发行版。选型需综合技术兼容性、运维成本、安全稳定等因素。推荐Alibaba Cloud Linux、Ubuntu等用于Web与容器场景,Windows Server支撑.NET应用。建议优先选用LTS版本并进行测试验证,通过标准化镜像管理提升部署效率与一致性。
|
6月前
|
存储 监控 安全
阿里云渠道商:云服务器价格有什么变动?
阿里云带宽与存储费用呈基础资源降价、增值服务差异化趋势。企业应结合业务特点,通过阶梯计价、智能分层、弹性带宽等策略优化成本,借助云监控与预算预警机制,实现高效、可控的云资源管理。
|
6月前
|
弹性计算 运维 安全
阿里云轻量应用服务器38元1年和云服务器99元1年怎么选?二者性能区别及选择参考
在阿里云当下的活动中,38元/年的轻量应用服务器与99元/年的云服务器ECS成为众多新用户的关注焦点。但是有部分用户并不是很清楚二者之间的区别,因此就不知道应该如何选择。接下来,笔者将为您详细剖析ECS云服务器与轻量应用服务器的差异,以供您参考和选择。
612 4
阿里云轻量应用服务器38元1年和云服务器99元1年怎么选?二者性能区别及选择参考
|
6月前
|
弹性计算 搜索推荐 异构计算
租用阿里云服务器一年要多少钱?ECS、轻量和GPU服务器租赁价格,手动整理
2025年10月阿里云服务器优惠持续,轻量应用服务器200M带宽38元起/年,ECS 2核2G 99元/年、2核4G 199元/年,4核16G 89元/月,8核32G 160元/月,香港轻量25元/月起,新老同享,续费不涨价。
1247 2
|
6月前
|
存储 弹性计算 监控
阿里云渠道商:如何挑选阿里云服务器配置?
本文详解通用型、计算型、内存型等实例适用场景,结合性能评估与成本优化策略,助力用户按需选择。以日均1万访问企业网站为例,2核4G+3M带宽月费约200元,性价比高。合理配置更省钱。
|
弹性计算 网络协议 Linux
第二章:阿里云ECS服务器(G5)安装配置docker
第二章:阿里云ECS服务器(G5)安装配置docker
526 0
|
弹性计算 NoSQL 网络协议
阿里云ECS使用docker部署redis并远程连接
本文主要介绍如何在阿里云ECS服务器上通过docker部署redis,并在springboot项目中添加redis依赖进行远程连接。
阿里云ECS使用docker部署redis并远程连接
|
9月前
|
弹性计算 关系型数据库 Nacos
低配阿里云 ECS 如何 docker 环境部署 NACOS : 单机版模式
NACOS 单机版 Docker 安装指南。使用指定端口和 custom.env 配置文件启动 Nacos 服务,适用于 2.X 版本,包含 gRPC 支持及 MySQL 数据源配置。 -e MODE=standalone \
713 5

热门文章

最新文章