linux环境安装docker和dockercompose 命令页表快速完成
- 如果你熟悉docker, 就没必要每次都去一个一个命令开始复制 粘贴 执行 浪费时间. 直接把整理好的所有命令放入一次执行即可.
- 如果你是小白, 需要直接搭建环境成功,看到直观效果, 这里就可以. 可以增长信息,提升学习兴趣. 不至于浪费时间太多,热情冷却.
docker快速直接执行:
#Uninstall old versions O#lder versions of Docker were called docker or docker-engine. If these are installed, uninstall them, along with associated sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine #SET UP THE REPOSITORY #Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver. sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2 #Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well. sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo #Optional: Enable the edge and test repositories. These repositories are included in the docker.repo file above but are disabled by default. You can enable them alongside the stable repository. sudo yum-config-manager --enable docker-ce-edge sudo yum-config-manager --enable docker-ce-test #You can disable the edge or test repository by running the yum-config-manager command with the --disable flag. To re-enable it, use the --enable flag. The following command disables the edge repository. sudo yum-config-manager --disable docker-ce-edge #INSTALL DOCKER CE #Install the latest version of Docker CE, or go to the next step to install a specific version: sudo yum install docker-ce #If prompted to accept the GPG key, verify that the fingerprint matches 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35, and if so, accept it #Got multiple Docker repositories? #If you have multiple Docker repositories enabled, installing or updating without specifying a version in the yum install or yum update command always installs the highest possible version, which may not be appropriate for your stability needs. #Docker is installed but not started. The docker group is created, but no users are added to the group. #To install a specific version of Docker CE, list the available versions in the repo, then select and install: #a. List and sort the versions available in your repo. This example sorts results by version number, highest to lowest, and is truncated: yum list docker-ce --showduplicates | sort -r #Start Docker. sudo systemctl start docker #Verify that docker is installed correctly by running the hello-world image. sudo docker run hello-world
#Run this command to download the latest version of Docker Compose: sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose #Apply executable permissions to the binary: sudo chmod +x /usr/local/bin/docker-compose #Test the installation. docker-compose --version
参考:
安装docker和docker-compose
具体安装步骤:
- docker:https://docs.docker.com/engine/installation/
- docker-compose:https://docs.docker.com/compose/install/
注意:Docker安装要求Linux 3.10
以上版本,用uname -a
命令可查看到。
安装之后,可查看版本:
$ docker -v $ docker-compose -v
然后把当前用户加到docker
用户组里面:
$ sudo gpasswd -a ${USER} docker
就不用每次启动Docker都得加sudo
了。
注意,执行gpasswd
命令之后要重新登陆才有效。
来源: https://www.awaimai.com/2120.html
低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
linux中利用docker和docker-compose搭建lnmp环境详解 10分钟快速完成
本文主要包括部分注意事项 重要信息提示快速执行安装的纯命令相关介绍配置文件,参考地址1.要求说明: linux, 安装了docker和docker compose 特别注意: 本文中提及的密码与本文的配置文件可能不一致(与新详情参考文中的密码同:123456),简单改成了mima123456, 文中用的123456在进行说明 windows环境中,项目中mysql的连接主机为 172...和localhost都连接失败 (Linux中用宿主机ip连接成功--没探究原因,欢迎评论补全)安装成功后, 我发现项目连接 数据库的时候连接不了, 一直是 Connection timed out(2002) ,但是我使用 cmd , navicate, 都能够连接, 而且 localhost, 172.0.0.1, 和对应的docker ip 都是可以连接的, 就是php项目中无法连接 一直提示 连接超时. 项目运行正常, 我的其他项目连接的其他服务器的数据库也是访问正常的.linux环境未遇到此问题,直接用服务器这个宿主机的ip就链接成功了的windows解决记录:项目连接数据库成功了 使用如...
- 下一篇
一起来聊聊自己使用的企业级项目开发技术栈~
一起来聊聊自己使用的企业级项目开发技术栈~ 【赠书】《Spring Boot 开发实战》作者与你探讨最佳实践的开发-小虾2018参与的聚能聊话题-云栖社区 http://yq.aliyun.com/roundtable/325534/answer/608736#visit608736 1.Java 程序员到了必须学习 Spring Boot 的时候了吗? 说起 Spring Boot 我们不得不先了解一下 Spring 这个企业,不仅因为 Spring Boot 来源于 Spirng 大家族,而且 Spring Boot 的诞生和 Sping 框架的发展息息相关。 时间回到2002年,当时正是 Java EE 和 EJB 大行其道的时候,很多知名公司都是采用此技术方案进行项目开发。这时候有一个美国的小伙子认为 EJB 太过臃肿,并不是所有的项目都需要使用 EJB 这种大型框架,应该会有一种更好的方案来解决这个问题。 为了证明他的想法是正确的,于2002年10月甚至写了一本书《 Expert One-on-One J2EE 》,介绍了当时 Java 企业应用程序开发的情况,并指出了 Ja...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- CentOS关闭SELinux安全模块
- SpringBoot2初体验,简单认识spring boot2并且搭建基础工程
- SpringBoot2整合Redis,开启缓存,提高访问速度
- MySQL8.0.19开启GTID主从同步CentOS8
- Hadoop3单机部署,实现最简伪集群
- 设置Eclipse缩进为4个空格,增强代码规范
- CentOS7,CentOS8安装Elasticsearch6.8.6
- Linux系统CentOS6、CentOS7手动修改IP地址
- CentOS6,7,8上安装Nginx,支持https2.0的开启
- Windows10,CentOS7,CentOS8安装MongoDB4.0.16