centos docker 迁移到ubuntu_Docker实战

本文介绍了如何将Centos上的Docker迁移到Ubuntu,包括使用MobaXterm登录服务器、Centos中Docker的安装、Docker实战如Hello World、交互式容器、后台运行容器、运行web应用以及镜像和容器的管理。详细步骤帮助读者完成Docker环境的迁移和操作。
摘要由CSDN通过智能技术生成

Docker实战

4ffa66dab8ae2c0e633452df93979af7.png

作者:hackett

微信公众号:加班猿

一、准备工具

云服务器

我用的是腾讯云的Centos7.5 64位不到一百块一年的云服务器,你也可以用虚拟机

d7fbaea844cd2ab6e939294c0e35c489.png

二、登录服务器工具

MobaXterm

1、之所以用这个作为ssh客户端,主要原因就是基于MobaXterm强大且丰富的功能,并且还都是免费的

MobaXterm主要功能:

  • 支持各种连接 SSH,X11,RDP,VNC,FTP,MOSH
  • 支持 Unix 命令(bash,ls,cat,sed,grep,awk,rsync,…)
  • 连接 SSH 终端后支持 SFTP 传输文件
  • 各种丰富的插件(git/dig/aria2…)
  • 可运行 Windows 或软件

下载地址:https://mobaxterm.mobatek.net/download-home-edition.html

50af1ae753b5338c95c95c9b50927e1c.png

2、登录服务器

7c475002d0af1d0b264d1a63e97dd395.png

三、Centos Docker安装

1、使用官方安装脚本安装

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

2、使用国内 daocloud 一键安装命令

curl -sSL https://get.daocloud.io/docker | sh

3、检查是否安装成功(docker -v)

[root@VM-0-11-centos ~]# docker -v
Docker version 20.10.0, build 7287ab3
[root@VM-0-11-centos ~]#

4、启动docker

sudo systemctl start docker

5、通过hello world映像验证是否正确安装Docker

[root@VM-0-11-centos ~]# sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:1a523af650137b8accdaed439c17d684df61ee4d74feac151b5b337bd29e7eec
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 tha
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值