美文网首页
docker 安装开发环境 - (1)安装centos

docker 安装开发环境 - (1)安装centos

作者: 良人与我 | 来源:发表于2019-04-26 18:05 被阅读0次

工作需要同时部署三个环境所以想采用docker 快速部署
每个环境需要 mysql 、java 、 mongodb 、elasticsearch、rabbitmq、jekens、redis

拉取centos镜像

sudo docker pull daocloud.io/centos:7

查看镜像

[river@bogon ~]$ sudo docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
hello-world          latest              fce289e99eb9        3 months ago        1.84kB
daocloud.io/centos   7                   1e1148e4cc2c        4 months ago        202MB

启动一个bash交互终端

[river@bogon ~]$ sudo docker run -it --privileged=true daocloud.io/centos:7 /bin/bash
[root@255b799c5285 /]#

添加新用户

[root@255b799c5285 /]# adduser river
[root@255b799c5285 /]# passwd river
Changing password for user river.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.

安装必要的linux 工具

[root@255b799c5285 /]yum -y install wget
[root@255b799c5285 /]# yum install sudo

将用户添加到sudo中

[root@255b799c5285 /]# vi /etc/sudoers
找到这一 行:"root ALL=(ALL) ALL"在起下面添加"xxx ALL=(ALL) ALL"(这里的xxx是你的用户名)

切换到 river用户 下

[root@255b799c5285 /]# su river

参考地址
http://www.runoob.com/docker/docker-tutorial.html

docker 安装开发环境 - (1)安装centos

相关文章

网友评论

      本文标题:docker 安装开发环境 - (1)安装centos

      本文链接:https://www.haomeiwen.com/subject/pxaxnqtx.html