1,安装
1、检查内核版本,必须是3.10及以上 uname ‐r 2、安装docker yum install docker 3、输入y确认安装 4、启动docker [root@localhost ~]# systemctl start docker [root@localhost ~]# docker ‐v Docker version 1.12.6, build 3e8e77d/1.12.6 5、开机启动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. 6、停止docker systemctl stop docker
2,docker与宿主机交互
安装es docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9200:9200 -p 9300:9300 --name ten_es 5acf0e8da90b 进入容器 docker exec -it ten_es /bin/bash 退出 exit #将容器的文件映射到宿主机上 docker cp ten_es:/usr/share/elasticsearch/config/elasticsearch.yml /usr/share/elasticsearch.yml #文件映射 docker cp ik ten_es:/usr/share/elasticsearch/plugins