Docker:centos79-docker-compose安装记录

1.安装环境:centos7.9 x86 

2.安装最新版:

[root@localhost ~]# curl -fsSL get.docker.com -o get-docker.sh
[root@localhost ~]# sh get-docker.sh
# Executing docker install script, commit: e5543d473431b782227f8908005543bb4389b8de
+ sh -c 'yum install -y -q yum-utils'
+ sh -c 'yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo'
Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
+ '[' stable '!=' stable ']'
+ sh -c 'yum makecache'
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                                                                                    | 5.0 kB  00:00:00* base: mirrors.bfsu.edu.cn* epel: mirrors.bfsu.edu.cn* extras: mirrors.huaweicloud.com* updates: mirrors.huaweicloud.com
base                                                                                                                                                                                    | 3.6 kB  00:00:00
docker-ce-stable                                                                                                                                                                        | 3.5 kB  00:00:00
extras                                                                                                                                                                                  | 2.9 kB  00:00:00
updates                                                                                                                                                                                 | 2.9 kB  00:00:00
(1/13): base/7/x86_64/filelists_db                                                                                                                                                      | 7.2 MB  00:00:00
(2/13): base/7/x86_64/other_db                                                                                                                                                          | 2.6 MB  00:00:00
(3/13): docker-ce-stable/7/x86_64/filelists_db                                                                                                                                          |  57 kB  00:00:01
(4/13): docker-ce-stable/7/x86_64/updateinfo                                                                                                                                            |   55 B  00:00:02
(5/13): docker-ce-stable/7/x86_64/primary_db                                                                                                                                            | 131 kB  00:00:01
(6/13): epel/x86_64/filelists_db                                                                                                                                                        |  12 MB  00:00:00
(7/13): epel/x86_64/prestodelta                                                                                                                                                         | 1.8 kB  00:00:00
(8/13): extras/7/x86_64/other_db                                                                                                                                                        | 150 kB  00:00:00
(9/13): extras/7/x86_64/filelists_db                                                                                                                                                    | 303 kB  00:00:00
(10/13): epel/x86_64/other_db                                                                                                                                                           | 3.4 MB  00:00:00
(11/13): updates/7/x86_64/other_db                                                                                                                                                      | 1.5 MB  00:00:00
(12/13): docker-ce-stable/7/x86_64/other_db                                                                                                                                             | 142 kB  00:00:01
(13/13): updates/7/x86_64/filelists_db                                                                                                                                                  |  14 MB  00:00:00
Metadata Cache Created
+ sh -c 'yum install -y -q docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-ce-rootless-extras docker-buildx-plugin'
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/docker-buildx-plugin-0.12.1-1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Public key for docker-buildx-plugin-0.12.1-1.el7.x86_64.rpm is not installed
Importing GPG key 0x621E9F35:Userid     : "Docker Release (CE rpm) <docker@docker.com>"Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35From       : https://download.docker.com/linux/centos/gpg================================================================================To run Docker as a non-privileged user, consider setting up the
Docker daemon in rootless mode for your user:dockerd-rootless-setuptool.sh installVisit https://docs.docker.com/go/rootless/ to learn about rootless mode.To run the Docker daemon as a fully privileged service, but granting non-root
users access, refer to https://docs.docker.com/go/daemon-access/WARNING: Access to the remote API on a privileged Docker daemon is equivalentto root access on the host. Refer to the 'Docker daemon attack surface'documentation for details: https://docs.docker.com/go/attack-surface/================================================================================[root@localhost ~]#

 2.检查版本,测试程序

[root@localhost ~]# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[root@localhost ~]# docker -v
Docker version 25.0.2, build 29cf629
[root@localhost ~]# systemctl start docker
[root@localhost ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost ~]# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
[root@localhost ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull complete
Digest: sha256:4bd78111b6914a99dbc560e6a20eab57ff6655aea4a80c50b0c5491968cbc2e6
Status: Downloaded newer image for hello-world:latestHello 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 theexecutable that produces the output you are currently reading.4. The Docker daemon streamed that output to the Docker client, which sent itto your terminal.To try something more ambitious, you can run an Ubuntu container with:$ docker run -it ubuntu bashShare 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.下载docker-compose:

chmod +x /usr/local/bin/docker-compose

[root@localhost ~]# sudo curl -L https://github.com/docker/compose/releases/download/v2.21.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose% Total    % Received % Xferd  Average Speed   Time    Time     Time  CurrentDload  Upload   Total   Spent    Left  Speed0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 56.7M  100 56.7M    0     0  75758      0  0:13:05  0:13:05 --:--:--  478k
[root@localhost ~]# chmod +x /usr/local/bin/docker-compose
[root@localhost ~]# docker-compose --version
Docker Compose version v2.21.0
[root@localhost ~]# pip install docker-compose
-bash: pip: command not found

4.下载python

[root@localhost ~]# yum install python
[root@localhost ~]# yum install python-pip
[root@localhost ~]# python
Python 2.7.5 (default, Nov 14 2023, 16:14:06)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
[root@localhost ~]# pip -V
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)

5.编写docker-compose.yam文件

version: "5"
services:db:image: postgres:9.4volumes:- db-data:/var/lib/postgresql/datanetworks:- backenddeploy:placement:constraints: [node.role == manager]networks:frontend:backend:volumes:db-data:
[root@localhost dhome]# docker-compose -f docker-compose.yml up -d
[+] Running 13/15⠏ db 14 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿] 49.44MB/53.62MB Pulling                                                                                                                                                 20.0s✔ 619014d83c02 Pull complete                                                                                                                                                                           5.3s✔ 7ec0fe6664f6 Pull complete                                                                                                                                                                           3.3s✔ 9ca7ba8f7764 Pull complete                                                                                                                                                                           1.3s✔ 9e1155d037e2 Pull complete                                                                                                                                                                           3.7s✔ febcfb7f8870 Pull complete                                                                                                                                                                           7.1s✔ 8c78c79412b5 Pull complete                                                                                                                                                                           5.5s✔ 5a35744405c5 Pull complete                                                                                                                                                                           6.6s✔ 27717922e067 Pull complete                                                                                                                                                                           6.8s⠼ 36f0c5255550 Downloading     [==============================================>    ]  49.44MB/53.62MB                                                                                                 16.5s✔ dbf0a396f422 Download complete                                                                                                                                                                       8.1s✔ ec4c06ea33e5 Download complete                                                                                                                                                                       8.5s✔ e8dd33eba6d1 Download complete                                                                                                                                                                       9.7s✔ 51c81b3b2c20 Download complete                                                                                                                                                                       9.7s✔ 2a03dd76f5d7 Download complete                                                                                                                                                                      11.0s

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/32378.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

记一次网站违规风险百度统计被禁用的经历及解决方法

今天登陆百度统计&#xff0c;提示&#xff1a;网站由于存在合规风险将被暂停使用百度统计服务。 为了满足法律法规及政府监管的最新规定和要求&#xff0c;保护广大网民的合法权益&#xff0c;您的网站由于存在合规风险将被暂停使用百度统计服务。违规域名&#xff1a;xxxxxx.…

django+uniapp

项目显示是前后端分离的模式django项目正常跑起来UniAPP项目直接打包正式web,打包出来的时候选择hash和文件路径/static/project/UniAPP项目部署到服务器中,/project直接部署到django对应的static的下面网页启动模式是通过静态文件的方式访问和启动 问题 负载均衡&#xff0c;…

使用Docker部署Java应用:从入门到实践

引言 随着容器化技术的兴起&#xff0c;Docker已成为部署和管理应用程序的热门选择。Docker提供了一种轻量级、可移植和自给自足的容器&#xff0c;使得应用部署变得简单且一致。本文将详细介绍如何使用Docker部署Java应用程序&#xff0c;包括基础概念、环境搭建、Dockerfile…

IF膨胀时代,“水刊”当赢?2023热门“水刊”影响因子详解!

【欧亚科睿学术】 1 “四大水刊”详情 图片来源&#xff1a;欧亚科睿学术整理 “四大水刊”的影响因子均有所下跌&#xff0c;其中&#xff0c;曾经被列入中科院预警名单的期刊MEDICINE&#xff0c;其影响因子已是连续三年持续下降。从JCR分区来看&#xff0c;四本期刊分区均…

算法训练(leetcode)第十一天 | 144. 二叉树的前序遍历、145. 二叉树的后序遍历、94. 二叉树的中序遍历、102. 二叉树的层序遍历

刷题记录 144. 二叉树的前序遍历递归迭代 145. 二叉树的后序遍历递归迭代 94. 二叉树的中序遍历递归迭代 102. 二叉树的层序遍历 144. 二叉树的前序遍历 leetcode题目地址 二叉树前序遍历。 时间复杂度&#xff1a; O ( n ) O(n) O(n) 空间复杂度&#xff1a; O ( n ) O(n…

迈巴赫S480升级增强现实AR抬头显示hud比普通抬头显示HUD更好用吗

增强AR实景抬头显示HUD&#xff08;Augmented Reality Head-Up Display&#xff09;是一种更高级的驾驶辅助技术&#xff0c;相比于普通抬头显示HUD&#xff0c;它提供了更丰富、更具沉浸感的驾驶体验。以下是它比普通抬头显示HUD多的一些功能&#xff1a; • 信息呈现方式&am…

Flutter中的异步和多进程

Flutter 是一个用于创建高性能、高保真度移动应用的框架,它使用 Dart 编程语言。 在 Flutter 中,异步和多进程是两种不同的概念,用于解决不同的问题。 异步 (Asynchronous) 异步编程是一种编程范式,允许代码在等待操作完成(如网络请求、文件 I/O)时继续执行其他任务,而不…

MySQL数据库笔记(二)

第一章 单行函数 1.1 什么是函数 函数的作用是把我们经常使用的代码封装起来,需要的时候直接调用即可。这样既提高了代码效率,又提高了可维护性。在SQL中使用函数,极大地提高了用户对数据库的管理效率。 1.2 定义 操作数据对象。 接受参数返回一个结果。 只对一行进行…

【React】AntD组件的使用--极客园--02.登录模块

基本结构搭建 实现步骤 在 Login/index.js 中创建登录页面基本结构在 Login 目录中创建 index.scss 文件&#xff0c;指定组件样式将 logo.png 和 login.png 拷贝到 assets 目录中 代码实现 pages/Login/index.js import ./index.scss import { Card, Form, Input, Button }…

pandas.frame输出parquet

代码 import pandas as pd import pyarrow._parquet as pqdata pd.read_parquet("0000.parquet") total_rows len(data) half_row_num total_rows//2 print(half_row_num) first_half data.iloc[:20000] second_half data.iloc[20000:20000] # print(first_hal…

Nginx - 反向代理、负载均衡、动静分离、底层原理(案例实战分析)

目录 Nginx 开始 概述 安装&#xff08;非 Docker&#xff09; 配置环境变量 常用命令 配置文件概述 location 路径匹配方式 配置反向代理 实现效果 准备工作 具体配置 效果演示 配置负载均衡 实现效果 准备工作 具体配置 实现效果 其他负载均衡策略 配置动…

VUE3脚手架工具cli配置搭建及创建VUE工程

1、VUE的脚手架工具(CLI&#xff09; 开发大型vue的时候&#xff0c;不能通过html编写一个大型的项目&#xff0c;这个时候需要用到vue的脚手架工具 通过vue的脚手架&#xff0c;可以快速的生成vue工程 1.1、安装nodejs和npm 【下载nodejs】 https://nodejs.org/en 【安装…

代码随想录算法训练营刷题复习8 :回溯算法——子集、排列、棋盘问题

回溯算法 子集问题 ①res,path; backtracking函数 ②无递归终止条件判断&#xff0c;直接path存入res&#xff1b; ③递归需要startIndex&#xff1b; ④(补充)“有重复元素、不能包含重复的解集” 在for循环多加判断条件&#xff1a;i>0 && used[i-1]false &…

IDEA快速入门06-插件

六、插件 6.1 IDEA插件介绍和管理 手动演示IDEA中怎么下载插件&#xff0c;管理插件等。 File -> Settings -> Plugins 6.2 Alibaba Java Coding Guidelines 6.2.1 实时检查 6.2.2 主动检查 选中【项目名称】或者【某一个具体类】&#xff0c;右键点击【编码规约扫…

本专栏代码部分使用到的head.h

本专栏代码部分使用到的head.h 存放路径在根目录下的 /usr/include/head.h #ifndef __HEAD_H__ #define __HEAD_H__#include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <s…

atcoder abc 358

A welcome to AtCoder Land 题目&#xff1a; 思路&#xff1a;字符串比较 代码&#xff1a; #include <bits/stdc.h>using namespace std;int main() {string a, b;cin >> a >> b;if(a "AtCoder" && b "Land") cout <&…

汽车OTA--Flash RWW属性为什么这么重要

目录 1. OTA与RWW 1.1 FOTA需求解读 1.2 什么是RWW 2.主流OTA方案 2.1 单Bank升级 2.2 基于硬件A\B SWAP的FOTA方案 2.3 基于软件实现的FOTA方案 3.小结 1. OTA与RWW 1.1 FOTA需求解读 CP AUTOSAR R19-11首次提出了FOTA的概念&#xff0c;针对FOTA Target ECU提出了多…

状态压缩DP——AcWing 291. 蒙德里安的梦想

状态压缩DP 定义 状态压缩DP是一种利用二进制数来表示状态的动态规划算法。它通过将状态压缩成一个整数&#xff0c;从而减少状态数量&#xff0c;提高算法效率。 运用情况 状态压缩DP通常用于解决具有状态转移和最优解性质的问题&#xff0c;例如组合优化、图论、游戏等问…

AI大眼萌探索 AI 新世界:Ollama 使用指南【1】

在人工智能的浪潮中&#xff0c;Ollama 的出现无疑为 Windows 用户带来了一场革命。这款工具平台以其开创性的功能&#xff0c;简化了 AI 模型的开发与应用&#xff0c;让每一位爱好者都能轻松驾驭 AI 的强大力量。大家好&#xff0c;我是AI大眼萌&#xff0c;今天我们将带大家…

GPT-4o一夜被赶超,Claude 3.5一夜封王|快手可灵大模型推出图生视频功能|“纯血”鸿蒙大战苹果AI|智谱AI“钱途”黯淡|月之暗面被曝进军美国

快手可灵大模型推出图生视频功能“纯血”鸿蒙大战苹果AI&#xff0c;华为成败在此一举大模型低价火拼间&#xff0c;智谱AI“钱途”黯淡手握新“王者”&#xff0c;腾讯又跟渠道干上了“美食荒漠”杭州&#xff0c;走出一个餐饮IPOGPT-4o一夜被赶超&#xff0c;Anthropic推出Cl…