• docker的常用命令


    export M2_HOME=/home/ubuntu/maven
    export PATH=${M2_HOME}/bin:$PATH
    
    
    #java environment
    export JAVA_HOME=/home/java/jdk1.8.0_261
    export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
    export PATH=$PATH:${JAVA_HOME}/bin
    
    
    [Unit]
    Description=nacos
    After=network.target
     
    [Service]
    Type=forking
    ExecStart=/home/nacos/bin/startup.sh -m standalone
    ExecReload=/home/nacos/bin/shutdown.sh
    ExecStop=/home/nacos/bin/shutdown.sh
    PrivateTmp=true
     
    [Install]
    WantedBy=multi-user.targe
    
    docker run -d --name es -p 9200:9200 -p 9300:9300  -e "discovery.type=single-node"   -v D:/java/es/data:/usr/share/elasticsearch/data -v D:/java/es/plugins:/usr/share/elasticsearch/plugins -v D:/java/es/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml elasticsearch:7.6.2
    
    
    docker run --name kibana -e ELASTICSEARCH_HOSTS=http://172.17.0.2:9200 -p 5601:5601 -d kibana:7.6.2
    
    
    docker run -d --name es2 -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" 5acf0e8da90b
    
    
    server.port: 5601
    server.host: 0.0.0.0
    elasticsearch.hosts: [ "http://172.17.0.3:9200" ]
    i18n.locale: "Zh-CN"
    
    docker run --name kibana -e ELASTICSEARCH_HOSTS=http://172.17.0.3:9200 -p 5601:5601 -d kibana:7.6.2
    
    
    docker run -d --name kibana --link elasticsearch:es -e "I18N_LOCALE=zh-CN" -p 5601:5601 kibana:7.6.2
    
    docker run -d --hostname my-rabbit --name rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3.8
    
    docker run -p 27017:27017  -d mongo
    
    docker run --name mongodb -p 27017:27017 -v D:/java/db/mongo:/data/db -d mongo:4.2.9 --auth
    
    docker exec -it  fa0bbfaab0fa  mongo admin
    
    $ 
    docker volume create --name = mongodata 
    docker run -itd --name mongo -p 27017:27017 -v mongodata:/data/db mongo:4.2.9 --auth
    
    db.createUser({ user:'root',pwd:'root',roles:[ { role:'userAdminAnyDatabase', db: 'admin'}]});
    
    docker save e4247c08758e > D:/java/vm/data/mongon.tar
    
    docker run -d 
    -e PREFER_HOST_MODE=ip 
    -e MODE=standalone 
    -e SPRING_DATASOURCE_PLATFORM=mysql 
    -e MYSQL_SERVICE_HOST=172.17.0.2 
    -e MYSQL_SERVICE_PORT=3306 
    -e MYSQL_SERVICE_USER=root 
    -e MYSQL_SERVICE_PASSWORD=root 
    -e MYSQL_SERVICE_DB_NAME=nacos 
    -e TIME_ZONE='Asia/Shanghai' 
    -v /home/pig/nacos/logs:/home/nacos/logs 
    -p 8848:8848 
    --name nacos 
    --restart=always 
    nacos/nacos-server:1.3.2
    
    
    docker network create --subnet=172.17.0.0/24 mynetwork
    
    
    redis
    
    docker run -p 6379:6379 
    --name redis 
    -v /mnt/d/java/vm/data/redis/redis.conf:/etc/redis/redis.conf 
    -v /mnt/d/java/vm/data/redis/data:/data 
    -d redis:6.0 
    redis-server /etc/redis/redis.conf --appendonly yes
    
    
    mysql
    docker run 
    --net mynetwork --ip 172.18.0.2 
    --name mysql 
    --privileged=true 
    -p 3306:3306  
    -e MYSQL_ROOT_PASSWORD=root 
    -d mysql:5.7
    
    -v /mnt/d/java/vm/data/mysql/conf/conf.d:/etc/mysql/conf.d 
    -v /mnt/d/java/vm/data/mysql/data:/var/lib/mysql 
    -v /mnt/d/java/vm/data/mysql/logs:/logs 
    
    
    nacos
    
    docker run -d 
    -e PREFER_HOST_MODE=ip 
    -e MODE=standalone 
    -e SPRING_DATASOURCE_PLATFORM=mysql 
    -e MYSQL_SERVICE_HOST=172.18.0.1 
    -e MYSQL_SERVICE_PORT=3306 
    -e MYSQL_SERVICE_USER=root 
    -e MYSQL_SERVICE_PASSWORD=root 
    -e MYSQL_SERVICE_DB_NAME=nacos 
    -v /mnt/d/java/vm/data/nacos/logs:/home/nacos/logs 
    -e TIME_ZONE='Asia/Shanghai' 
    -p 8848:8848 
    --name nacos 
    --restart=always 
    nacos:1.3
    
    
  • 相关阅读:
    机器学习(04)——常用专业术语
    C# 线程同步的三类情景
    线程同步的情景之三
    线程同步的情景之二
    线程同步的情景之一
    Thread.Sleep(0) vs Sleep(1) vs Yeild
    Visual Studio 实用扩展推荐
    为革命保护视力 --- 给 Visual Studio 换颜色
    免费的精品: Productivity Power Tools 动画演示
    如何扩展 Visual Studio 编辑器
  • 原文地址:https://www.cnblogs.com/pigll/p/13567644.html
Copyright © 2020-2023  润新知