docker 常用容器创建(自用)

mysql容器创建

docker run -p 3306:3306 --name mysql \
-v /wzy/dockerdata/mysql/mysql-log:/var/log/mysql \
-v /wzy/dockerdata/mysql/mysql-data:/var/lib/mysql \
-v /wzy/dockerdata/mysql/mysql-conf:/etc/mysql \
-v /wzy/dockerdata/mysql/mysql-files:/var/lib/mysql-files \
-e MYSQL_ROOT_PASSWORD=root \
-d mysql:8.0.11

redis容器创建

docker run --rm -d --name redis -p 6379:6379 redis:6.0.20 --requirepass "root"

rabbitmq容器创建

docker run \
 -e RABBITMQ_DEFAULT_USER=root \
 -e RABBITMQ_DEFAULT_PASS=root \
 --name rabbitMQ \
 --hostname rabbitMQ_host \
 -p 15672:15672 \
 -p 5672:5672 \
 -d \
 rabbitmq:3-management

es,kibana网络创建

docker network create es-net

es容器创建

docker run -d --name elasticsearch \
    -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
    -e "discovery.type=single-node" \
    -v /wzy/dockerdata/elasticsearch/es-data:/usr/share/elasticsearch/data \
    -v /wzy/dockerdata/elasticsearch/es-plugins:/usr/share/elasticsearch/plugins \
    -v /wzy/dockerdata/elasticsearch/es-logs:/usr/share/elasticsearch/logs \
    --privileged \
    --network es-net \
    -p 9200:9200 \
    -p 9300:9300 \
elasticsearch:7.12.1

kibana容器创建

docker run -d \
--name kibana \
-e ELASTICSEARCH_HOSTS=http://elasticsearch:9200 \
--network=es-net \
-p 5601:5601  \
kibana:7.12.1

nacos容器创建

docker run -d -p 8848:8848 \
-e MODE=standalone \
-e PREFER_HOST_MODE=hostname \
-v /wzy/dockerdata/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties \
-v /wzy/dockerdata/nacos/logs:/home/nacos/logs \
--restart always \
--name nacos nacos/nacos-server

mongdb容器创建

docker run \
-d \
--name mongo \
--privileged=true \
-p 27017:27017 \
-v /wzy/dockerdata/mongoDB/mongo-data:/data/db \
mongo:4.2.2

zookeeper容器创建

docker run -e TZ="Asia/Shanghai" \
-d \
-p 2181:2181 \
-v /wzy/dockerdata/zookeeper/zk-data:/data \
--name zookeeper \
zookeeper:3.7.1

minio容器创建

docker run -p 9000:9000 -p 9090:9090 \
 --name minio \
 -d --restart=always \
 -e "MINIO_ACCESS_KEY=root" \
 -e "MINIO_SECRET_KEY=root123456" \
 -v /wzy/dockerdata/minio/data:/data  \
 -v /wzy/dockerdata/minio/config:/root/.minio \
 minio/minio  server\
 /data --console-address ":9090" -address ":9000"

gitlab容器创建

docker run -d -p 8443:443 -p 8090:80 -p 8022:22 --restart always --name gitlab -v /wzy/dockerdata/gitlab/etc:/etc/gitlab -v /wzy/dockerdata/gitlab/log:/var/log/gitlab -v /wzy/dockerdata/gitlab/data:/var/opt/gitlab --privileged=true twang2218/gitlab-ce-zh

jenkins 容器创建

docker run -d -u root \
-p 8080:8080 -p 50000:50000 \
-v /wzy/dockerdata/jenkins/jenkins_home:/var/jenkins_home \
-v /wzy/dockerdata/jenkins/jenkins_localtime:/etc/localtime \
--name jenkins jenkinsci/blueocean:1.24.1-bcc31d32159f

xxl-job容器创建

docker run -d \
-e PARAMS="--spring.datasource.url=jdbc:mysql://124.223.174.88:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=UTC \
--spring.datasource.username=root \
--spring.datasource.password=root \
--spring.datasource.driver-class-name=com.mysql.jdbc.Driver" \
-p  8282:8080 \
-v /wzy/dockerdata/xxjob/applogs:/data/applogs \
--name my-xxl-job-admin-2.3.1  \
-d xuxueli/xxl-job-admin:2.3.1

rabbitmq容器创建

docker run \
 -e RABBITMQ_DEFAULT_USER=root \
 -e RABBITMQ_DEFAULT_PASS=root \
 --name rabbitMQ \
 --hostname rabbitMQ_host \
 -p 15672:15672 \
 -p 5672:5672 \
 -d \
 rabbitmq:3-management

rabbitmq容器创建

docker run \
 -e RABBITMQ_DEFAULT_USER=root \
 -e RABBITMQ_DEFAULT_PASS=root \
 --name rabbitMQ \
 --hostname rabbitMQ_host \
 -p 15672:15672 \
 -p 5672:5672 \
 -d \
 rabbitmq:3-management

rabbitmq容器创建

docker run \
 -e RABBITMQ_DEFAULT_USER=root \
 -e RABBITMQ_DEFAULT_PASS=root \
 --name rabbitMQ \
 --hostname rabbitMQ_host \
 -p 15672:15672 \
 -p 5672:5672 \
 -d \
 rabbitmq:3-management

你可能感兴趣的:(Linux,docker,容器,运维)