Docker安装各服务命令

  • 2017-09-05
  • 174
  • 3
  • 0

docker 加速

安装/升级你的Docker客户端

您可以通过阿里云的镜像仓库下载:mirrors.aliyun.com/help/docker-engine

或执行以下命令:

curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -

如何使用Docker加速器
针对Docker客户端版本大于1.10的用户

您可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器:

sudo mkdir -p /etc/dockersudo tee /etc/docker/daemon.json <<-'EOF'{ "registry-mirrors": ["https://3i5v73bz.mirror.aliyuncs.com"]}EOF
systemctl daemon-reload
systemctl restart docker

参考:https://cr.console.aliyun.com/?spm=5176.1971733.2.28.394b9fbdrASJma#/accelerator

tomcat

server.xml , 后加

Context path="" docBase="/home/tomcat/apache-tomcat-8.5.16/webapps/doudou/" debug="0"/>
docker run -p 1006:8080 -it -v /home/tomcat/:/home/tomcat/ --name tomcat  docker.io/openjdk /bin/bash

redis

docker run -p 6379:6379 -itd --name redis redis

mysql

docker run --name mysql -p 3306:3306 -e MYSQL\_ROOT\_PASSWORD=new.1234 -d mysql

rabbitmq

docker run -p 15672:15672 -itd --name rabbitmq letsxo/rabbitmq

nginx

docker run -it -p 80:80 -v `pwd`/www:/www -v `pwd`/config:/etc/nginx/sites-enabled  -v `pwd`/logs:/var/log/nginx nginx

elasticSearch 2.3.5

docker run -d -p 9200:9200 --name="es" elasticsearch:2.3.5

  • 安装ansj插件
${ES_HOME}./bin/plugin install http://maven.nlpcn.org/org/ansj/elasticsearch-analysis-ansj/2.3.5.3/elasticsearch-analysis-ansj-2.3.5.3-release.zip
  • 安装head插件

${ES_HOME}./bin/plugin install mobz/elasticsearch-head

showdoc

代码地址:https://github.com/star7th/showdoc

docker build -t showdoc ./
docker run -d --name showdoc -p 4999:80 showdoc  `

在浏览器中访问http://xxxx.com:4999/install/

jenkins

docker search jenkins
mkdir /home/jenkins
docker run -p 28080:8080 -p 50000:50000 -v /home/jenkins:/var/jenkins_home jenkins

评论