首页 > 系统相关 >安装Docker容器(Linux系统)

安装Docker容器(Linux系统)

时间:2023-07-01 10:03:30浏览次数:44  
标签:容器 00 yum Linux Master Docker com docker


环境:CentOS7

  • 更新yum包
[root@Master ~]# yum update
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                            | 3.6 kB  00:00:00
extras                                                          | 2.9 kB  00:00:00
updates                                                         | 2.9 kB  00:00:00
  • 安装相关软件包(yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的)
[root@Master ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
Loaded plugins: fastestmirror
  • 设置yum源为阿里云
[root@Master ~]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Loaded plugins: fastestmirror
adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
grabbing file http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
  • 安装docker
[root@Master ~]# yum install docker-ce
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
  • 验证是否成功
[root@Master ~]# docker -v
Docker version 20.10.8, build 3967b7d

[root@Master docker]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b8dfde127a29: Pull complete
Digest: sha256:7d91b69e04a9029b99f3585aaaccae2baa80bcf318f4a5d2165a9898cd2dc0a1
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服务
[root@Master ~]# systemctl start docker
[root@Master ~]# systemctl status docker
[root@Master ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.


标签:容器,00,yum,Linux,Master,Docker,com,docker
From: https://blog.51cto.com/chshyz/6598080

相关文章

  • Linux 上的 .NET 如何自主生成 Dump
    一:背景1.讲故事前几天微信上有位朋友找到我,说他程序的线程数会偶发性瞬时飙高,让我看下大概是什么原因,截图如下:如果这种问题每天都会出现,比较好的做法就是用dotnet-trace捕获ThreadCreated事件,但可气的是朋友说大概一个月发生次把,这种情况下用dotnet-trace持续监视就没必要......
  • Linux Shell用户界面
    预计更新1:基础知识简介和安装基本命令变量和环境变量2:流程控制条件语句循环语句函数3:文件处理文件读写文件权限和所有权文件搜索和替换4:网络和进程网络通信进程管理信号处理5:文本处理正则表达式文本分析和处理生成报告和日志6:用户界面命令行参数和选......
  • 《Linux C/C++ 服务器开发实践》记录
    《LinuxC/C++服务器开发实践》记录序言:该记录是一份读书笔记,因为主题需要和计算机操作系统有关,自然而然的想到Linux的学习,刚好最近找实习发现很多C++服务器方向需要熟悉Windows/Linux的多线程开发,所以就选了这本《LinuxC/C++服务器开发实践》来看,这本书有许多工作用得上的知......
  • 如何在多个 Linux 服务器上运行多个命令
    动动发财的小手,点个赞吧!如果你正在管理多台Linux服务器,并且你想在所有Linux服务器上运行多个命令,但你不知道该怎么做。不用担心,在这个简单的服务器管理指南中,我们将向您展示如何在多个Linux服务器上同时运行多个命令。为此,您可以使用pssh(并行ssh)程序,这是一个用于在多个......
  • docker使用笔记
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@docker批量启动与停止容器::dockerstart$(dockerps-a-q)试试看 dockerstop$(dockerps-a-q)试试看 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@centos7安装shipyard没有本地容器及镜像:方法:.设置防火墙[root@c2~]#firewall-cmd--z......
  • linux 使用随笔
    目录:1,ab命令一,ab命令ab网站压力测试命令的参数、输出结果的中文注解ab命令是Apache的Web服务器的性能测试工具,它可以测试安装Web服务器每秒种处理的HTTP请求。来自: http://man.linuxde.net/ab-A:指定连接服务器的基本的认证凭据;-c:指定一次向服务器发出请求数;-C:添加cookie;-g:将测......
  • Linux中yum和apt-get用法及区别
    Linux中yum和apt-get用法及区别 一般来说著名的linux系统基本上分两大类: 1.RedHat系列:Redhat、Centos、Fedora等 2.Debian系列:Debian、Ubuntu等 RedHat系列 1常见的安装包格式rpm包,安装rpm包的命令是“rpm-参数” 2包管理工具 yum 3支持tar包  Debian系列1常见......
  • Linux系统上检查用户创建日期
    1、https://cloud.tencent.com/developer/news/199201您知道如何在Linux系统上检查用户帐户创建日期吗?如果是,有什么方法可以做。你在这方面取得成功了吗?如果是,怎么办?基本上Linux操作系统不会跟踪这些信息,因此,获取这些信息的替代方法是什么?你可能会问为什么我想检查这个?是的,在......
  • linux系统OpenSSL 升级
    建议版本升级:OpenSSL1.0.2-1.0.2zd>>>>OpenSSL1.0.2:升级至1.1.1oOpenSSL1.1.1-1.1.1n>>>>OpenSSL1.1.1:升级至1.1.1oOpenSSL3.0.0、3.0.1、3.0.2>>>>OpenSSL3.0:升级至3.0.3查看版本号:opensslversion1下载安全版本:openssl官网:https://www.openssl......
  • Linux必学技能 | 17个案例带运维小白快速精通Awk命令,拿来即用
    awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在对数据分析并生成报告时,显得尤为强大。简单来说awk就是把文件逐行地读入,以空格为默认分隔符将每行切片,切开的部分再进行各种分析处理。awk有三个不同的版本:awk、nawk和gawk,未作特别说明,一般指gawk,gawk是awk的GNU版本。之......