该文档是基于CentOS7.9,7、64位系统编写的
Docker错误
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| # 如果容器启动报如下警告 # 是没有开启转发,docker网桥配置完后,需要开启转发,不然容器启动后,就会没有网络 IPv4 forwarding is disabled. Networking will not work
# 修改配置文件 vi /etc/sysctl.conf
# 将下列内容加入进去 net.ipv4.ip_forward=1
# 重启网络和docker systemctl restart network systemctl restart docker
# 查看是否修改成功【如果返回为“net.ipv4.ip_forward = 1”则表示修改成功】 sysctl net.ipv4.ip_forward
|
portainer
-v /var/run/docker.sock:/var/run/docker.sock
不要改不要改
汉化参考地址:https://imnks.com/3406.html
如果汉化文件在上面地址中下载不了,去阿里云盘下载
docker-compose
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| version: "3.8"
services:
portainer: container_name: portainer image: portainer/portainer-ce:2.16.2 restart: always ports: - "19443:9443" - "18000:8000" volumes: - /var/run/docker.sock:/var/run/docker.sock - ./portainer/data:/data - ./portainer/public:/public networks: - xiaofei-net networks: xiaofei-net:
|
docker run
1 2 3 4 5 6
| docker run -d -p 19000:9000 -p 19443:9443 -p 18000:8000 \ --name portainer --restart=always \ -v /var/run/docker.sock:/var/run/docker.sock \ -v ./portainer/data:/data \ -v ./portainer/public:/public \ portainer/portainer-ce:2.16.2
|
可道云
可道云多人版
Docker-Compose安装可道云多人版,安装前先参考下面链接文档
参考:https://hub.docker.com/r/kodcloud/kodbox
可道云个人版
1
| docker run -d -p 80:80 -v /xiaofei/kodexplorer/data:/var/www/html kodcloud/kodexplorer
|
bitwarden
参考:https://hub.docker.com/r/vaultwarden/server
docker-compose
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| version: "3.8"
services: bitwarden: image: vaultwarden/server:1.27.0 container_name: bitwarden restart: always ports: - "80:80" volumes: - ./bitwarden/data:/data environment: SIGNUPS_ALLOWED: 'false' TZ: 'Asia/Shanghai' SERVER_ADMIN_EMAIL: ${BITWARDEN_SERVER_ADMIN_EMAIL} INVITATIONS_ALLOWED: 'true' WEBSOCKET_ENABLED: 'true' ADMIN_TOKEN: ${BITWARDEN_ADMIN_TOKEN}
|
docker run
1
| docker run -d --name bitwarden -v ./bitwarden/data:/data -p 80:80 vaultwarden/server:1.27.0
|
Redis
1 2
| docker run -p 6379:6379 -d -v /xiaofei/test/redis/conf:/usr/local/etc/redis \ --name redis redis:5.0 redis-server /usr/local/etc/redis/redis.conf
|
总结
docker-compose
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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
| version: "3.8"
services:
redis: container_name: redis image: redis:6.2 restart: always ports: - "6379:6379" volumes: - ./redis/conf/redis.conf:/etc/redis/redis.conf - ./redis/data:/data networks: - xiaofei-net # 根据自定义配置文件启动redis command: redis-server /etc/redis/redis.conf
mysql: container_name: mysql image: mysql:8.0.28 build: context: ./mysql dockerfile: dockerfile restart: always environment: MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} MYSQL_ALLOW_EMPTY_PASSWORD: 'no' MYSQL_DATABASE: ${MYSQL_DATABASE} MYSQL_USER: ${MYSQL_USER} MYSQL_PASSWORD: ${MYSQL_PASSWORD} ports: - "3306:3306" volumes: - ./mysql/data:/var/lib/mysql - ./mysql/conf:/etc/mysql/conf.d networks: - xiaofei-net command: --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --default-authentication-plugin=mysql_native_password #解决外部无法访问
nacos: container_name: nacos restart: always environment: - MODE=standalone - SPRING_DATASOURCE_PLATFORM=mysql - MYSQL_SERVICE_HOST=mysql_host - MYSQL_SERVICE_PORT=3306 - MYSQL_SERVICE_DB_NAME=mysql_db - MYSQL_SERVICE_USER=mysql_user - MYSQL_SERVICE_PASSWORD=mysql_password - MYSQL_SERVICE_DB_PARAM=characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&serverTimezone=UTC ports: - '8848:8848' - '9848:9848' networks: - xiaofei-net image: 'nacos/nacos-server:v2.2.0' depends_on: - mysql links: - mysql
rabbitmq: container_name: rabbit image: rabbitmq:3.9-management restart: always hostname: my-rabbit environment: RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER} RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS} ports: - "15672:15672" - "5672:5672" networks: - xiaofei-net
bitwarden: image: vaultwarden/server:1.27.0 container_name: bitwarden restart: always ports: - "80:80" volumes: - ./bitwarden/data:/data networks: - xiaofei-net environment: SIGNUPS_ALLOWED: 'false' TZ: 'Asia/Shanghai' SERVER_ADMIN_EMAIL: ${BITWARDEN_SERVER_ADMIN_EMAIL} INVITATIONS_ALLOWED: 'true' WEBSOCKET_ENABLED: 'true' ADMIN_TOKEN: ${BITWARDEN_ADMIN_TOKEN} minio: container_name: minio image: minio/minio:RELEASE.2023-03-20T20-16-18Z restart: always environment: MINIO_ROOT_USER: ${MINIO_ROOT_USER} MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD} networks: - xiaofei-net ports: - "9000:9000" - "9090:9090" volumes: - ./minio/data:/data - ./minio/certs:/root/.minio/certs command: server /data --console-address ":9090"
elasticsearch_742: container_name: elasticsearch_742 image: elasticsearch:7.4.2 restart: always ports: - "9200:9200" - "9300:9300" environment: - "discovery.type=single-node" - "ES_JAVA_OPTS=-Xms64m -Xmx512m" networks: - xiaofei-net volumes: - ./elasticsearch_742/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml - ./elasticsearch_742/data:/usr/share/elasticsearch/data - ./elasticsearch_742/plugins:/usr/share/elasticsearch/plugins
kibana_742: image: kibana:7.4.2 container_name: kibana_742 restart: always ports: - "5601:5601" environment: SERVER_NAME: kibana742 ELASTICSEARCH_HOSTS: http://elasticsearch_742:9200 volumes: - ./kibana_742/config/kibana.yml:/usr/share/kibana/config/kibana.yml networks: - xiaofei-net depends_on: - elasticsearch_742 links: - elasticsearch_742
alist: restart: always volumes: - './alist/data:/opt/alist/data' ports: - '5244:5244' networks: - xiaofei-net environment: - PUID=0 - PGID=0 - UMASK=022 container_name: alist image: 'xhofe/alist:v3.13.1'
portainer: container_name: portainer image: portainer/portainer-ce:2.16.2 restart: always ports: # http访问端口 #- "19000:9000" # https:访问端口 - "19443:9443" - "18000:8000" volumes: - /var/run/docker.sock:/var/run/docker.sock - ./portainer/data:/data # ./portainer/public目录下面一定要放 - ./portainer/public:/public networks: - xiaofei-net
networks: xiaofei-net:
|
.env
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| MYSQL_ROOT_PASSWORD= MYSQL_DATABASE= MYSQL_USER= MYSQL_PASSWORD=
MYSQL_HOST= MYSQL_PORT=
NACOS_SPRING_DATASOURCE_PLATFORM= NACOS_MYSQL_SERVICE_DB_NAME= NACOS_MYSQL_SERVICE_USER= NACOS_MYSQL_SERVICE_PASSWORD= NACOS_MYSQL_SERVICE_DB_PARAM=
RABBITMQ_DEFAULT_USER= RABBITMQ_DEFAULT_PASS=
BITWARDEN_SERVER_ADMIN_EMAIL= BITWARDEN_ADMIN_TOKEN=
MINIO_ROOT_USER= MINIO_ROOT_PASSWORD=
|