Docker安装常用软件

docker安装

#查看已启动的服务
systemctl list-units --type=service

#查看是否设置开机启动
systemctl list-unit-files | grep enable

#设置开机启动
systemctl enable docker.service

docker软件安装脚本

#安装docker管理工具portainer http://127.0.0.1:9000  英文版
docker pull portainer/portainer
docker run -di --name portainer --restart=always -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer

#mac系统安装
docker run -d -v "/var/run/docker.sock:/var/run/docker.sock" -p 9000:9000 --name=portainer portainer/portainer

#中文汉化版
mkdir -p /data/portainer/data /data/portainer/public
cd /data/portainer

#下载附件 portainer/portainer:1.20.2
wget https://dl.quchao.net/Soft/Portainer-CN.zip
unzip Portainer-CN.zip -d public
docker run -d --restart=always --name portainer -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /data/portainer/data:/data -v /data/portainer/public:/public portainer/portainer

#docker安装rabbitmq
docker pull rabbitmq:management
docker run -dit --name rabbitmq  --restart=always -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin -p 15672:15672 -p 5672:5672 rabbitmq:management

#docker安装redis
docker pull redis
docker run -di --name redis --restart=always -p 6379:6379 redis --requirepass 123456

#启动zookeeper
docker pull zookeeper
docker run -di --name zookeeper --restart=always -p 2181:2181 zookeeper

#安装mysql
docker pull mysql:latest
docker run -itd --name  mysql --restart=always -p 3306:3306 -e MYSQL_ROOT_PASSWORD=rootmysql

#安装mongodb
docker pull mongo:latest
docker run -itd --name mongo --restart=always -p 27017:27017 mongo --auth

$ docker exec -it mongo mongo admin
# 创建一个名为 admin,密码为 123456 的用户。>  db.createUser({ user:'admin',pwd:'123456',roles:[ { role:'userAdminAnyDatabase', db: 'admin'},"readWriteAnyDatabase"]});# 尝试使用上面创建的用户信息进行连接。> db.auth('admin', '123456')


#安装elasticsearch
docker pull elasticsearch:7.7.0
docker run --name elasticsearch -d -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -e "discovery.type=single-node" --restart=always -p 9200:9200 -p 9300:9300 elasticsearch:7.7.0

#安装ELK
docker pull kibana:7.7.0
docker pull sebp/elk:660
echo "vm.max_map_count=262144" > /etc/sysctl.conf
sysctl -p
docker run -dit --restart=always --name elk \
    -p 5601:5601 \
    -p 9200:9200 \
    -p 5044:5044 \
    -v /opt/elk-data:/var/lib/elasticsearch \
    -v /etc/localtime:/etc/localtime \
    sebp/elk:660
    
#安装jenkins
docker pull jenkins/jenkins:lts
mkdir -p /data/jenkins/jenkins_home
docker run -p 8080:8080 -p 50000:5000 --name jenkins \
-u root \
-v /data/jenkins/jenkins_home:/var/jenkins_home \
-d jenkins/jenkins:lts

#安装gitlab
docker pull gitlab/gitlab-ce:latest
mkdir -p /usr/local/share/gitlab/etc
mkdir -p /usr/local/share/gitlab/log
mkdir -p /usr/local/share/gitlab/opt
docker run \
 -itd  \
 -p 9980:80 \
 -p 9922:22 \
 -v /usr/local/share/gitlab/etc:/etc/gitlab  \
 -v /usr/local/share/gitlab/log:/var/log/gitlab \
 -v /usr/local/share/gitlab/opt:/var/opt/gitlab \
 --restart always \
 --privileged=true \
 --name gitlab-ce \
 gitlab/gitlab-ce

设置开机启动

#如果已经启动的项目,则使用update更新:
docker update --restart=always redis

你可能感兴趣的:(Docker容器,docker,rabbitmq,linux)