CentOS7安装Docker与使用篇

Centos7安装Docker 0.安装Docker Docker 分为 CE 和 EE 两大版本。CE 即社区版(免费,支持周期 7 个月),EE 即企业版,强调安全,付费使用,支持周期 24 个月。 Docker CE 分为 stable test 和 nightly 三个更新频道。 官方网站上有各种环境下的 安装指南,这里主要介绍 Docker CE 在 CentOS上的安装。 1.CentOS安装Docker Docker CE 支持 64 位版本 CentOS 7,并且要求内核版本不低于 3.10, CentOS 7 满足最低内 阅读详情

一、在CentOS7上安装docker篇

1. 查看系统版本:
$ cat /etc/redhat-release
CentOS Linux release 7.0.1406 (Core)

2. 安装docker
$ yum install docker
安装过程中报错:
Transaction check error:
file /usr/lib/systemd/system/blk-availability.service from install of device-mapper-7:1.02.107-5.el7_2.2.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64
file /usr/sbin/blkdeactivate from install of device-mapper-7:1.02.107-5.el7_2.2.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64
file /usr/share/man/man8/blkdeactivate.8.gz from install of device-mapper-7:1.02.107-5.el7_2.2.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64

解决办法:
$yum install libdevmapper* -y

再次运行:
$yum install docker

3.检查安装是否成功
$docker version
若输出了 Docker 的版本号,说明安装成功了,可通过以下命令启动 Docker 服务:

4. $service docker start
一旦 Docker 服务启动完毕,就可以开始使用 Docker 了。

二、使用docker

  1. 使用命令行的工具来检索名字为“tutorial”的镜像
    $docker search tutorial

  2. 使用docker命令来下载镜像
    $docker pull learn/tutorial

  3. 查看已下载的镜像
    $ docker images
    REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
    docker.io/learn/tutorial latest 2d13ac7ee948 3 years ago 128 MB

  4. 在docker容器中运行hello world!

    docker run命令有两个参数,一个是镜像名,一个是要在镜像中运行的命令。
    $docker run learn/tutorial echo “hello word”

  5. 在容器中安装新的程序(wget命令)
    $docker run learn/tutorial apt-get install -y wget

  6. 使用docker ps -l命令获得安装完ping命令之后容器的id。然后把这个镜像保存为learn/wget。
    $ docker ps -l
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    1861c071d861 learn/tutorial “apt-get install -y w” 2 minutes ago Exited (0) 2 minutes ago furious_panini

  7. 保存对容器的修改
    $ docker commit 1861c071d861 learn/wget
    ad2245a8acd8014c39ad46b503cc8e74ce4202d9b4b4fdf48596b596b88059b4
    执行完docker commit命令之后,返回新版本镜像的id号

  8. 运行新的镜像
    到现在为止,我们已经建立了一个完整的、自成体系的docker环境,并且安装了wget命令在里面。它可以在任何支持docker环境的系统中运行啦!(是不是很神奇呢?)让我们来体验一下吧!

    在新的镜像中运行wget “http://blog.youkuaiyun.com/yown” 命令。
    $docker run learn/wget wget “http://blog.youkuaiyun.com/yown”

    成功啦!
    $ docker ps -l
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    2e079c9ecac4 learn/wget “wget http://blog.csd” About a minute ago Exited (8) About a minute ago elegant_lumiere

  9. 检查运行中的镜像
    $docker inspect 2e079c9ecac4

  10. 发布自己的镜像
    a. 首先在www.docker.com注册账户,登录并在https://cloud.docker.com/repository/list 页面创建learn库

    b. 将刚才我们做的镜像起个新的名字:
    $docker tag learn/wget:latest yown/learn:latest

    c. 在命令行登录:
    $docker login

    d. 上传
    $docker push yown/learn:latest

    Do you really want to push to public registry? [y/n]: y
    The push refers to a repository [docker.io/yown/learn] (len: 1)
    ad2245a8acd8: Pushing [=========================> ] 6.482 MB/12.48 MB

至此,整个docker的使用已体验完啦!

【CentOS7】CentOS 7 Docker 安装 本文提供了2024年最新版CentOS 7系统安装Docker CE的完整指南。由于CentOS 7已停止官方维护,文章首先指导修复Yum源,详细说明了Docker安装步骤(包括卸载旧版本、安装依赖包、配置镜像源等),并提供了自动化安装脚本。文中还包含安装验证方法、常见问题排查和最佳实践建议。特别提醒:建议新项目迁移至Rocky Linux 9等现代系统,但本方案仍适用于必须使用CentOS 7的场景。 阅读详情

相关推荐

CenterOS7搭建docker运行环境

Docker

朗晴的技术博客 7345

一篇文章完成Centos7安装docker

博主最新再学习docker,分享一下安装的心得,同步会更新到优快云上 一、环境准备 虚拟机 1台 系统版本 CentOS Linux release 7.8.2003 (Core) 内核版本 5.16.2-1.el7.elrepo.x86_64 访问外网 放通 源 阿里源 卸载docker 参

做人如果没有梦想,那跟咸鱼有什么区别--周星驰 2万+

【Docker篇】最新最全 CentOS7安装Docker教程(持续更新中)

一旦公钥导入成功,你就可以继续安装 Docker CE 了。首先,确保你的系统已经启用了 Docker 仓库。首先,你需要导入 Docker 的官方 GPG 密钥。其他安装失败的情况后续发现,再继续给大佬们完善。2.4 更新yum包缓存并安装 Docker CE。的条目,这表示密钥已成功导入。3.2 设置为开机自动启动。

qq_34463511的博客 2346

Centos7安装docker详细教程

1、Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker。4、安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的。9、验证安装是否成功(有client和service两部分表示docker安装启动都成功了)6、可以查看所有仓库中所有docker版本,并选择特定版本安装。3、卸载旧版本(如果安装过旧版本的话)7、安装docker,版本号自选。

Moye's Blog 1万+

open-mmlab / mmpose安装、使用教程

mmpose安装、使用教程mmpose安装教程1. 安装mmcv-full2. 安装MMPose2. 安装mmdet使用教程1. 预测图片2. 预测视频 mmpose mmpose是商汤旗下有又一款好用的工具箱,主要是针对姿态识别任务开发的,包括人体姿态识别和动物姿态识别。里面继承很多现成的网络可以供大家使用,并且提供了训练好的权重。用户可以更具自己的需求训练自己的数据,或者直接应用他们的结果,反正就是很全面啦!!!! github连接:https://github.com/open-mmlab/mmpos

CharmsLUO的博客 1万+

洛谷 P5736 【深基7.例2】质数筛

题目描述 输入 n(n\le100)n(n≤100) 个不大于 100000 的整数。要求全部储存在数组中,去除掉不是质数的数字,依次输出剩余的质数。 输入格式 无 输出格式 无 输入输出样例 输入 #1 复制 5 3 4 5 6 7 输出 #1 复制 3 5 7 板子题,使用一下线性筛 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using n

qq_37978559的博客 1117

Docker安装篇(CentOS7安装)

  本文记录下在CentOS7上安装docker的过程 1.首先确认版本   首先确认我们的环境是centOS7 cat /etc/redhat-release 2.yum安装gcc相关   前提是能上外网,上篇文章介绍了相关的网络配置,不清楚的key参考下。 yum -y install gcc gcc-c++ 3.卸载旧的版本   防止其他版本的干扰,我们先执行删除旧版本的命令 yum...

波波烤鸭的博客 1万+

SV--对象拷贝、参数化的类

对象拷贝,参数化的类

创芯人--fly的博客 1570

【CentOS7】Linux安装Docker教程(保姆篇)

安装docker偏简单,大家会遇到各种各样的问题,目前论坛知识相对丰富,大家可以根据自己所遇到的问题去解决,或者进行评论区留言。正常这些命令copy直接用应该会畅通无阻,本人是自建虚拟机去试了很多次了,祝贺大家都能开始Hello World。这个命令将会下载一个测试镜像然后在Docker中运行一个容器,然后输出一条欢迎消息并退出。如果在卸载过程中遇到端口占用可以杀死端口。如果已安装,请卸载重新安装。

A的博客 3万+

深入解析XTEA加密算法的核心机制与优化策略

本文深入解析XTEA加密算法的核心机制与优化策略,详细介绍了XTEA在嵌入式系统和资源受限环境中的优势,包括其高效的加解密速度和低资源消耗。文章还探讨了XTEA的轮函数设计、关键参数优化策略以及实战应用中的性能对比,为开发者提供了安全增强方案和优化技巧。

k8l9m0n的博客 242

【异常】XXL-JOB提示异常ERROR com.xxl.job.core.util.XxlJobRemotingUtil - connect timed out

打开XXL-JOB的ELK,发现一堆报错。

奶爸的编程之路,也就一周冷个三天 2047

Docker篇介绍+CentOS7安装Docker教程

Docker学习,如何在虚拟机中安装docker

qq_26849881的博客 302

【Bluedroid】BLE连接过程详解

Bluedroid BLE的链接过程包括扫描、连接和通信三个基本步骤。通过这些步骤,中央设备和外围设备之间可以建立起稳定、高效的通信链路,实现数据传输和控制操作。

byte轻骑兵的技术小窝 1876

【云原生 | Docker 基础篇】02、CentOS 7 安装 Docker 详细图文教程

根据官网安装手册安装docker。

GG Bond 的博客 1万+

uniapp:实现APP获取陀螺仪数据、加速传感器、线性加速传感器,uniApp实时监听陀螺仪【XYZ】数据及停止监听与资源释放等功能示例源码,根据需求做功能(完美兼容Android安卓、苹果ios)

uniapp陀螺仪,uniapp加速传感器,uniapp线性加速传感器,APP陀螺仪数据,uniapp app 端获取陀螺仪数据示例代码,手机中获取陀螺仪的数据,uniApp实时获取陀螺仪xyz数据,android陀螺仪方向,获得陀螺仪传感器,处理传感器数据,停止监听与资源释放,Android使用陀螺仪,uniapp苹果ios陀螺仪,uni-app设备之(加速计,罗盘,陀螺仪)插件安卓/IOS APP提供了获取陀螺仪数据的能力,手机陀螺仪传感器获得手机自身旋转的角度,陀螺仪获取旋转角度,陀螺仪、加速度传感器

✅ 精选推荐文章 4266

【Claude】Not logged in · Please run /login 报错已解决

意味着 Claude Code 没有找到任何有效凭证。直接/login——交互式首选;检查——排查环境变量污染;CI 用——自动化场景标准方案;macOS Keychain 异常——/logout/login重置;时钟偏差——校准系统时间。参考:Claude Code 官方《错误参考》"身份验证"章节、官方认证优先级文档、社区 Token 过期排查记录。

博客 9976

CentOS7安装docker 启动不了解决篇

[root@test ~]# yum update [root@test ~]# yum install docker [root@test ~]# service docker start Redirecting to /bin/systemctl start docker.service Job for docker.service failed because th...

1187

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

在CentOS7上安装docker篇

一、在CentOS7上安装docker篇 1. 查看系统版本:$ cat /etc/redhat-releaseCentOS Linux release 7.0.1406 (Core) 2. 安装docker$ yum install docker安装过程中报错:Transaction check error:file /usr/lib/systemd/system/bl...

weixin_30500663的博客 83

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

Docker - CentOS7下安装Docker篇

Linux安装DockerDocker 安装如果想安装不同的版本设置Docker默认存储目录 Docker 安装 Step 1: 安装yum-utils sudo yum install -y yum-utils Step 2: 设置为阿里云镜像仓库 sudo yum-config-manager \ --add-repo \ http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo Step 3: 直接安装最新do

liyu109766的博客 301

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

centos7篇---安装nvidia-docker

centos7安装nvidia-docker

心惠天意 2274
上一篇: Nosql Mongodb 并发控制之乐观锁
下一篇: nosql mongodb group分组统计及索引优化
yown
博客等级 码龄24年 33粉丝 78原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值