1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| yum install docker yum install docker-compose service docker start
# 修改为国内镜像
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://xxxx.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
# 安装
docker pull mysql
# Run
docker run --name mysql --restart unless-stopped -p 3306:3306 -e MYSQL_ROOT_PASSWORD=910123 -d -v /mnt/mysql:/var/lib/mysql mysql # Stop
docker stop mysql # Start
docker start mysql
docker run --name elasticsearch --restart unless-stopped -p 9200:9200 -p 9300:9300 \ -v /mnt/elasticsearch/data:/usr/share/elasticsearch/data -e ES_JAVA_OPTS="-Xms128m -Xmx128m" \ -e "discovery.type=single-node" -d elasticsearch
docker run --name redis --restart unless-stopped -p 6379:6379 -v /mnt/redis/data:/data -d redis redis-server --appendonly yes
# jenkins
docker pull jenkins chown -R 1000:1000 /mnt/jenkins/ docker run --restart unless-stopped -p 8080:8080 -p 50000:50000 --name jenkins -v /mnt/jenkins:/var/jenkins_home -d jenkins
# jenkins php $ docker pull limingxinleo/jenkins-php-docker $ useradd jenkins $ chown -R jenkins:jenkins /mnt/jenkins/ $ docker run --restart unless-stopped -p 8080:8080 -p 50000:50000 --name jenkins \ -e "PATH=/home/jenkins/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ -v "/mnt/jenkins:/var/jenkins_home" -d limingxinleo/jenkins-php-docker
|