From 2116e098517bf3d4422f3d2cdeef2ab848e0ff9e Mon Sep 17 00:00:00 2001 From: 8ga Date: Mon, 13 Oct 2025 13:48:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20DockerCollection.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DockerCmdCollection.md | 12 ----- DockerCollection.md | 115 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 12 deletions(-) delete mode 100644 DockerCmdCollection.md create mode 100644 DockerCollection.md diff --git a/DockerCmdCollection.md b/DockerCmdCollection.md deleted file mode 100644 index 548acde..0000000 --- a/DockerCmdCollection.md +++ /dev/null @@ -1,12 +0,0 @@ -## Grafana - -```shell -docker run \ --d \ ---name grafana-12.1.1 \ --p 宿主机端口号:3000 \ --v 替换成数据存储目录:/var/lib/grafana \ --v 替换成日志存储目录:/var/log/grafana \ --v 替换成插件存储目录:/var/lib/grafana/plugins \ -swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/grafana/grafana-oss:12.1.1 -``` \ No newline at end of file diff --git a/DockerCollection.md b/DockerCollection.md new file mode 100644 index 0000000..2562fbe --- /dev/null +++ b/DockerCollection.md @@ -0,0 +1,115 @@ +## 安装 DPanel + +```shell +docker run \ + -d \ + -p 端口号:8080 \ + -e APP_NAME=dpanel \ + --name dpanel \ + --restart=always \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v 替换成DPanel的存储目录:/dpanel \ + registry.cn-hangzhou.aliyuncs.com/dpanel/dpanel:lite +``` + +## 基于毫秒镜像源构建 Maven、OpenJDK21、git 的 Dockerfile + +```shell +FROM docker.1ms.run/eclipse-temurin:21-jdk +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN sed -i s@http://archive.ubuntu.com/@http://mirrors.tuna.tsinghua.edu.cn/@g /etc/apt/sources.list && \ + sed -i s@http://security.ubuntu.com/@http://mirrors.tuna.tsinghua.edu.cn/@g /etc/apt/sources.list && \ + apt-get update && \ + apt-get install -y git maven && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* +``` + +## 基于毫秒镜像源构建 Maven、OpenJDK8、git 的 Dockerfile + +```shell +FROM docker.1ms.run/maven:3.8.6-jdk-8 +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +# 阿里云镜像源 +RUN echo "deb https://mirrors.aliyun.com/debian/ bullseye main contrib non-free" > /etc/apt/sources.list && \ + echo "deb https://mirrors.aliyun.com/debian-security/ bullseye-security main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb https://mirrors.aliyun.com/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list && \ + apt-get update && \ + apt-get install -y git && \ + rm -rf /var/lib/apt/lists/* +``` + +## 基于毫秒镜像源构建 node:16、git、nginx 的 Dockerfile + +```shell +FROM docker.1ms.run/node:16-alpine +# 阿里云镜像源 +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories +RUN apk add --no-cache git nginx +``` + +## 安装 Grafana + +```shell +docker run \ +-d \ +--name grafana-12.1.1 \ +-p 宿主机端口号:3000 \ +-v 替换成数据存储目录:/var/lib/grafana \ +-v 替换成日志存储目录:/var/log/grafana \ +-v 替换成插件存储目录:/var/lib/grafana/plugins \ +swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/grafana/grafana-oss:12.1.1 +``` + +## 安装 Mysql 8.4.5 + +参数按需调整 + +``` +docker run -d \ + --name mysql-8.4.5 \ + -e MYSQL_ROOT_PASSWORD='设置root登录密码' \ + -p 宿主机端口号:3306 \ + -v 替换成mysql存储目录:/var/lib/mysql \ + --memory="2g" \ + --memory-swap="-1" \ + --restart=on-failure:3 \ + swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/mysql:8.4.5 \ + --max_connections=100 \ + --tmp_table_size=67108864 \ + --max_heap_table_size=67108864 \ + --innodb_buffer_pool_size=536870912 \ + --innodb_log_file_size=134217728 \ + --thread_cache_size=16 \ + --slow_query_log=1 \ + --log_output='TABLE' \ + --long_query_time=5 \ + --bind-address=0.0.0.0 \ + --skip-name-resolve +``` + +## 安装 Redis 6.2.6 + +参数按需调整 +``` +docker run -d \ + --name redis-6.2.6 \ + --memory="512m" \ + --memory-swap="-1" \ + --restart=on-failure:3 \ + -p 宿主机端口号:6379 \ + -v 替换成redis持久化存储目录:/data \ + -e REDIS_PORT=6379 \ + -e REDIS_REQUIREPASS='登录密码' \ + docker.1ms.run/redis:6.2.6 \ + redis-server --bind 0.0.0.0 \ + --requirepass 'Ketao@789!' \ + --appendonly no \ + --save "" \ + --dir /data \ + --daemonize no \ + --maxmemory 500mb \ + --maxmemory-policy allkeys-lru +``` \ No newline at end of file