├── .gitignore ├── README.MD ├── aria2 ├── Dockerfile ├── README.MD └── make.sh ├── civetweb ├── Dockerfile ├── README.MD └── make.sh ├── dnscrypt ├── Dockerfile ├── README.MD ├── dnscrypt-proxy.toml └── make.sh ├── dnsforwarder ├── Dockerfile └── make.sh ├── ffmpeg ├── Dockerfile ├── Dockerfile-bin └── README.MD ├── fluent └── Dockerfile ├── ftp ├── Dockerfile ├── Dockerfile-vsftpd ├── README.MD ├── make-vsftpd.sh └── make.sh ├── goproxy ├── Dockerfile ├── README.MD └── make.sh ├── haproxy ├── Dockerfile ├── Dockerfile-2.4 ├── README.MD ├── make-2.4.sh └── make.sh ├── http ├── darkhttpd └── make-darkhttpd.sh ├── influxdb ├── Dockerfile ├── Dockerfile-chronograf ├── Dockerfile-telegraf ├── README.MD ├── make-chronograf.sh ├── make-telegraf.sh └── make.sh ├── lighttpd ├── Dockerfile ├── Dockerfile-busybox ├── README.MD └── make.sh ├── memcached ├── Dockerfile ├── Dockerfile-arm32v7 ├── Dockerfile-arm64v8 ├── Dockerfile-busybox ├── README.MD └── make.sh ├── monit ├── Dockerfile ├── Dockerfile-slim ├── README.MD ├── make-slim.sh └── make.sh ├── mosdns ├── CN-ip-cidr.txt ├── Dockerfile ├── README.MD ├── accelerated-domains.china.txt ├── config.yaml ├── gfw.txt ├── hosts.txt └── proxy-list.txt ├── mosquitto ├── Dockerfile └── make.sh ├── nghttpx ├── Dockerfile ├── README.MD └── make.sh ├── nginx-google ├── .dockerignore ├── Dockerfile ├── README.MD ├── make.sh └── nginx.conf ├── nginx ├── Dockerfile ├── Dockerfile-arm32v7 ├── Dockerfile-arm64v8 ├── Dockerfile-busybox ├── Dockerfile-debug ├── Dockerfile-flv ├── Dockerfile-http3 ├── Dockerfile-rtmp ├── Dockerfile-stream ├── Dockerfile-tengine ├── README.MD ├── make.sh ├── makedebug.sh ├── makestream.sh └── maketengine.sh ├── node ├── Dockerfile ├── Dockerfile-arm32v7 ├── Dockerfile-arm64v8 ├── Dockerfile-pnpm ├── Dockerfile-yarn ├── README.MD ├── make.sh └── makeyarn.sh ├── nuster ├── Dockerfile ├── README.MD └── make.sh ├── openresty ├── Dockerfile └── make.sh ├── php ├── 81 │ ├── Dockerfile │ ├── Dockerfile-mongo │ ├── Dockerfile-redis │ ├── Dockerfile-swoole │ ├── make-redis.sh │ ├── make-swoole.sh │ └── make.sh ├── 82 │ ├── Dockerfile │ ├── Dockerfile-mongo │ ├── Dockerfile-redis │ ├── Dockerfile-swoole │ ├── make-redis.sh │ ├── make-swoole.sh │ └── make.sh ├── .dockerignore ├── Dockerfile ├── Dockerfile-cli ├── Dockerfile-fpm ├── Dockerfile-mongo ├── Dockerfile-redis ├── Dockerfile-swoole ├── README.MD ├── make-redis.sh ├── make-swoole.sh └── make.sh ├── polipo ├── Dockerfile ├── Dockerfile-proxy ├── Dockerfile-v2 ├── README.MD ├── make.sh ├── makeproxy.sh └── start.sh ├── port ├── Dockerfile ├── Dockerfile-portmapper ├── Dockerfile-redir ├── Dockerfile-socat ├── Dockerfile-tcpfwd ├── Dockerfile-udpfwd ├── README.MD ├── make-portmapper.sh ├── make-redir.sh ├── make-socat.sh └── make.sh ├── privoxy ├── Dockerfile ├── README.MD └── make.sh ├── puppeteer ├── Dockerfile ├── Dockerfile-cn ├── README.MD └── make.sh ├── python ├── Dockerfile ├── Makefile ├── README.MD ├── pillow-simd └── pillow-simd-sse ├── redis ├── Dockerfile ├── Dockerfile-arm32v7 ├── Dockerfile-arm64v8 ├── Dockerfile-busybox ├── README.MD └── make.sh ├── server ├── Dockerfile ├── README.MD ├── make.sh └── nginx.conf ├── shadowsocks ├── Dockerfile ├── Dockerfile-arm32v7 ├── Dockerfile-arm64v8 ├── Dockerfile-libev ├── Dockerfile-local ├── Dockerfile-server ├── README.MD ├── make-libev.sh └── make.sh ├── sniproxy ├── Dockerfile ├── README.MD ├── make.sh └── sniproxy.conf ├── squid ├── Dockerfile ├── README.MD └── make.sh ├── sshd ├── Dockerfile ├── Dockerfile-arm64v8 ├── Dockerfile-dropbear ├── Dockerfile-dropbear-arm64v8 ├── README.MD ├── make.sh └── makedropbear.sh ├── stunserver └── Dockerfile └── tools ├── README.MD ├── brook ├── Dockerfile ├── README.MD ├── make.sh └── run.sh ├── goaccess ├── Dockerfile └── README.MD ├── gost ├── Dockerfile └── make.sh ├── httptunnel ├── Dockerfile ├── README.MD └── make.sh ├── ngrep ├── Dockerfile ├── Dockerfile-arm64v8 ├── README.MD └── make.sh ├── suexec ├── Dockerfile └── make.sh ├── tcpflow ├── Dockerfile ├── README.MD └── make.sh ├── wrk ├── Dockerfile └── README.MD └── zstd └── Dockerfile /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /proxy 3 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | ## Docker 2 | 3 | **my dockerfile** 4 | 5 | 6 | docker images see here https://hub.docker.com/r/suconghou/ 7 | 8 | 9 | -------------------------------------------------------------------------------- /aria2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN wget -O- https://github.com/q3aql/aria2-static-builds/releases/download/v1.35.0/aria2-1.35.0-linux-gnu-64bit-build1.tar.bz2 | tar jx --strip 1 && \ 3 | mv aria2c ca-certificates.crt / 4 | 5 | FROM alpine 6 | COPY --from=build /aria2c /usr/local/bin/ 7 | COPY --from=build /ca-certificates.crt /etc/ssl/certs/ 8 | CMD [ "aria2c","--dir=/data/share","--continue=true","--stream-piece-selector=inorder","--file-allocation=none","--disable-ipv6=true","--enable-rpc=true","--rpc-allow-origin-all=true","--rpc-listen-all=true","--rpc-secret=will2020" ] 9 | -------------------------------------------------------------------------------- /aria2/README.MD: -------------------------------------------------------------------------------- 1 | ## aria2 2 | 3 | https://aria2.github.io/manual/en/html/aria2c.html#aria2-conf 4 | 5 | **config** 6 | 7 | ``` 8 | 9 | #等号后面内容为默认设置,如为空则无默认设置,请自行选取需要更改的添加到你的配置文件中 10 | 11 | #下载路径 12 | dir= 13 | 14 | #日志文件 15 | #日志文件的路径. 如果设置为 "-", 日志则写入到 stdout. 如果设置为空字符串(""), 日志将不会记录到磁盘上. 16 | log= 17 | 18 | #最大同时下载数 19 | max-concurrent-downloads=5 20 | 21 | #检查完整性 22 | #通过对文件的每个分块或整个文件进行哈希验证来检查文件的完整性. 此选项仅对BT、Metalink及设置了 --checksum 选项的 HTTP(S)/FTP 链接生效. 23 | check-integrity=false 24 | 25 | #断点续传 26 | #继续下载部分完成的文件. 启用此选项可以继续下载从浏览器或其他程序按顺序下载的文件. 此选项目前只支持 HTTP(S)/FTP 下载的文件. 27 | continue=true 28 | 29 | #代理服务器 30 | #设置所有协议的代理服务器地址. 如果覆盖之前设置的代理服务器, 使用 "" 即可. 您还可以针对特定的协议覆盖此选项, 即使用 --http-proxy, --https-proxy 和 --ftp-proxy 选项. 此设置将会影响所有下载. 代理服务器地址的格式为 [http://][USER:PASSWORD@]HOST[:PORT]. 31 | all-proxy= 32 | 33 | #代理服务器用户名 34 | all-proxy-user= 35 | 36 | #代理服务器密码 37 | all-proxy-passwd= 38 | 39 | #连接超时时间 40 | #设置建立 HTTP/FTP/代理服务器 连接的超时时间(秒). 当连接建立后, 此选项不再生效, 请使用 --timeout 选项. 41 | connect-timeout=60 42 | 43 | #模拟运行 44 | #如果设置为"是", aria2 将仅检查远程文件是否存在而不会下载文件内容. 此选项仅对 HTTP/FTP 下载生效. 如果设置为 true, BT 下载将会直接取消. 45 | dry-run=false 46 | 47 | #最小速度限制 48 | #当下载速度低于此选项设置的值(B/s) 时将会关闭连接. 0 表示不设置最小速度限制. 您可以增加数值的单位 K 或 M (1K = 1024, 1M = 1024K). 此选项不会影响 BT 下载. 49 | lowest-speed-limit=0 50 | 51 | #单服务器最大连接数 52 | max-connection-per-server=1 53 | 54 | #文件未找到重试次数 55 | #如果 aria2 从远程 HTTP/FTP 服务器收到 "文件未找到" 的状态超过此选项设置的次数后下载将会失败. 设置为 0 将会禁用此选项. 此选项仅影响 HTTP/FTP 服务器. 重试时同时会记录重试次数, 所以也需要设置 --max-tries 这个选项. 56 | max-file-not-found=0 57 | 58 | #最大尝试次数 59 | #设置最大尝试次数. 0 表示不限制. 60 | max-tries=5 61 | 62 | #最小文件分片大小 63 | #aria2 不会分割小于 2*SIZE 字节的文件. 例如, 文件大小为 20MB, 如果 SIZE 为 10M, aria2 会把文件分成 2 段 [0-10MB) 和 [10MB-20MB), 并且使用 2 个源进行下载 (如果 --split >= 2). 如果 SIZE 为 15M, 由于 2*15M > 20MB, 因此 aria2 不会分割文件并使用 1 个源进行下载. 您可以增加数值的单位 K 或 M (1K = 1024, 1M = 1024K). 可以设置的值为: 1M-1024M. 64 | min-split-size=20M 65 | 66 | #.netrc 文件路径 67 | netrc-path=$(HOME)/.netrc 68 | 69 | #禁用 netrc 70 | no-netrc=false 71 | 72 | #不使用代理服务器列表 73 | #设置不使用代理服务器的主机名, 域名, 包含或不包含子网掩码的网络地址, 多个使用逗号分隔. 74 | no-proxy= 75 | 76 | #文件名 77 | #下载文件的文件名. 其总是相对于 --dir 选项中设置的路径. 当使用 --force-sequential 参数时此选项无效. 78 | out= 79 | 80 | #代理服务器请求方法 81 | #设置用来请求代理服务器的方法. 方法可设置为 GET 或 TUNNEL. HTTPS 下载将忽略此选项并总是使用 TUNNEL. 82 | proxy-method=get 83 | 84 | #获取服务器文件时间 85 | #从 HTTP/FTP 服务获取远程文件的时间戳, 如果可用将设置到本地文件 86 | remote-time=false 87 | 88 | #URI 复用 89 | #当所有给定的 URI 地址都已使用, 继续使用已经使用过的 URI 地址. 90 | reuse-uri=true 91 | 92 | #重试等待时间 93 | #设置重试间隔时间(秒). 当此选项的值大于 0 时, aria2 在 HTTP 服务器返回 503 响应时将会重试. 94 | retry-wait=0 95 | 96 | #服务器状态保存文件 97 | #指定用来保存服务器状态的文件名. 您可以使用 --server-stat-if 参数读取保存的数据. 98 | server-stat-of= 99 | 100 | #服务器状态超时 101 | #指定服务器状态的过期时间 (单位为秒). 102 | server-stat-timeout=86400 103 | 104 | #单任务连接数 105 | #下载时使用 N 个连接. 如果提供超过 N 个 URI 地址, 则使用前 N 个地址, 剩余的地址将作为备用. 如果提供的 URI 地址不足 N 个, 这些地址多次使用以保证同时建立 N 个连接. 同一服务器的连接数会被 --max-connection-per-server 选项限制. 106 | split=5 107 | 108 | #分片选择算法 109 | #指定 HTTP/FTP 下载使用的分片选择算法. 分片表示的是并行下载时固定长度的分隔段. 如果设置为"默认", aria2 将会按减少建立连接数选择分片. 由于建立连接操作的成本较高, 因此这是合理的默认行为. 如果设置为"顺序", aria2 将选择索引最小的分片. 索引为 0 时表示为文件的第一个分片. 这将有助于视频的边下边播. --enable-http-pipelining 选项有助于减少重连接的开销. 请注意, aria2 依赖于 --min-split-size 选项, 所以有必要对 --min-split-size 选项设置一个合理的值. 如果设置为"随机", aria2 将随机选择一个分片. 就像"顺序"一样, 依赖于 --min-split-size 选项. 如果设置为"几何", aria2 会先选择索引最小的分片, 然后会为之前选择的分片保留指数增长的空间. 这将减少建立连接的次数, 同时文件开始部分将会先行下载. 这也有助于视频的边下边播. 110 | stream-piece-selector=default 111 | 112 | #超时时间 113 | timeout=60 114 | 115 | #URI 选择算法 116 | #指定 URI 选择的算法. 可选的值包括 "按顺序", "反馈" 和 "自适应". 如果设置为"按顺序", URI 将按列表中出现的顺序使用. 如果设置为"反馈", aria2 将根据之前的下载速度选择 URI 列表中下载速度最快的服务器. 同时也将有效跳过无效镜像. 之前统计的下载速度将作为服务器状态文件的一部分, 参见 --server-stat-of 和 --server-stat-if 选项. 如果设置为"自适应", 将从最好的镜像和保留的连接里选择一项. 补充说明, 其返回的镜像没有被测试过, 同时如果每个镜像都已经被测试过时, 返回的镜像还会被重新测试. 否则, 其将不会选择其他镜像. 例如"反馈", 其使用服务器状态文件. 117 | uri-selector=feedback 118 | 119 | #检查证书 120 | check-certificate=true 121 | 122 | #支持 GZip 123 | #如果远程服务器的响应头中包含 Content-Encoding: gzip 或 Content-Encoding: deflate , 将发送包含 Accept: deflate, gzip 的请求头并解压缩响应. 124 | http-accept-gzip=false 125 | 126 | #认证质询 127 | #仅当服务器需要时才发送 HTTP 认证请求头. 如果设置为"否", 每次都会发送认证请求头. 例外: 如果用户名和密码包含在 URI 中, 将忽略此选项并且每次都会发送认证请求头. 128 | http-auth-challenge=false 129 | 130 | #禁用缓存 131 | #发送的请求头中将包含 Cache-Control: no-cache 和 Pragma: no-cache header 以避免内容被缓存. 如果设置为"否", 上述请求头将不会发送, 同时您也可以使用 --header 选项将 Cache-Control 请求头添加进去. 132 | http-no-cache=false 133 | 134 | #HTTP 默认用户名 135 | http-user= 136 | 137 | #HTTP 默认密码 138 | http-passwd= 139 | 140 | #HTTP 代理服务器 141 | http-proxy= 142 | 143 | #HTTP 代理服务器用户名 144 | http-proxy-user= 145 | 146 | #HTTP 代理服务器密码 147 | http-proxy-passwd= 148 | 149 | #HTTPS 代理服务器 150 | https-proxy= 151 | 152 | #HTTPS 代理服务器用户名 153 | https-proxy-user= 154 | 155 | #HTTPS 代理服务器密码 156 | https-proxy-passwd= 157 | 158 | #请求来源 159 | #设置 HTTP 请求来源 (Referer). 此选项将影响所有 HTTP/HTTPS 下载. 如果设置为 *, 请求来源将设置为下载链接. 此选项可以配合 --parameterized-uri 选项使用. 160 | referer= 161 | 162 | #启用持久连接 163 | #启用 HTTP/1.1 持久连接. 164 | enable-http-keep-alive=true 165 | 166 | #启用 HTTP 管线化 167 | #启用 HTTP/1.1 管线化. 168 | enable-http-pipelining=false 169 | 170 | #自定义请求头 171 | #增加 HTTP 请求头内容. 172 | header= 173 | 174 | #Cookies 保存路径 175 | #以 Mozilla/Firefox(1.x/2.x)/Netscape 格式将 Cookies 保存到文件中. 如果文件已经存在, 将被覆盖. 会话过期的 Cookies 也将会保存, 其过期时间将会设置为 0. 176 | save-cookies= 177 | 178 | #启用 HEAD 方法 179 | #第一次请求 HTTP 服务器时使用 HEAD 方法. 180 | use-head=false 181 | 182 | #自定义 User Agent 183 | user-agent=aria2/$VERSION 184 | 185 | #FTP 默认用户名 186 | ftp-user=anonymous 187 | 188 | #FTP 默认密码 189 | #如果 URI 中包含用户名单不包含密码, aria2 首先会从 .netrc 文件中获取密码. 如果在 .netrc 文件中找到密码, 则使用该密码. 否则, 使用此选项设置的密码. 190 | ftp-passwd=ARIA2USER@ 191 | 192 | #被动模式 193 | #在 FTP 中使用被动模式. 如果设置为"否", 则使用主动模式. 此选项不适用于 SFTP 传输. 194 | ftp-pasv=true 195 | 196 | #FTP 代理服务器 197 | ftp-proxy= 198 | 199 | #FTP 代理服务器用户名 200 | ftp-proxy-user= 201 | 202 | #FTP 代理服务器密码 203 | ftp-proxy-passwd= 204 | 205 | #传输类型 206 | ftp-type=binary 207 | 208 | #连接复用 209 | ftp-reuse-connection=true 210 | 211 | #SSH 公钥校验和 212 | #设置 SSH 主机公钥的校验和. TYPE 为哈希类型. 支持的哈希类型为 sha-1 和 md5. DIGEST 是十六进制摘要. 例如: sha-1=b030503d4de4539dc7885e6f0f5e256704edf4c3. 此选项可以在使用 SFTP 时用来验证服务器的公钥. 如果此选项不设置, 即保留默认, 不会进行任何验证。 213 | ssh-host-key-md= 214 | 215 | #分离仅做种任务 216 | #统计当前活动下载任务(参见 -j 选项) 时排除仅做种的任务. 这意味着, 如果参数设置为 -j3, 此选项打开并且当前有 3 个正在活动的任务, 并且其中有 1 个进入做种模式, 那么其会从正在下载的数量中排除(即数量会变为 2), 在队列中等待的下一个任务将会开始执行. 但要知道, 在 RPC 方法中, 做种的任务仍然被认为是活动的下载任务. 217 | bt-detach-seed-only=false 218 | 219 | #启用哈希检查完成事件 220 | #允许 BT 下载哈希检查(参见 -V 选项) 完成后调用命令. 默认情况下, 当哈希检查成功后, 通过 --on-bt-download-complete 设置的命令将会被执行. 如果要禁用此行为, 请设置为"否". 221 | bt-enable-hook-after-hash-check=true 222 | 223 | #启用本地节点发现 (LPD) 224 | bt-enable-lpd=false 225 | 226 | #BT 排除服务器地址 227 | #逗号分隔的 BT 排除服务器地址. 您可以使用 * 匹配所有地址, 因此将排除所有服务器地址. 当在 shell 命令行使用 * 时, 需要使用转义符或引号. 228 | bt-exclude-tracker= 229 | 230 | #外部 IP 地址 231 | #指定用在 BitTorrent 下载和 DHT 中的外部 IP 地址. 它可能被发送到 BitTorrent 服务器. 对于 DHT, 此选项将会报告本地节点正在下载特定的种子. 这对于在私有网络中使用 DHT 非常关键. 虽然这个方法叫外部, 但其可以接受各种类型的 IP 地址. 232 | bt-external-ip= 233 | 234 | #强制加密 235 | #BT 消息中的内容需要使用 arc4 加密. 此选项是设置 --bt-require-crypto --bt-min-crypto-level=arc4 这两个选项的快捷方式. 此选项不会修改上述两个选项的内容. 如果设置为"是", 将拒绝以前的 BT 握手, 并仅使用模糊握手及加密消息. 236 | bt-force-encryption=false 237 | 238 | #做种前检查文件哈希 239 | #如果设置为"是", 当使用 --check-integrity 选项完成哈希检查及文件完成后才继续做种. 如果您希望仅当文件损坏或未完成时检查文件, 请设置为"否". 此选项仅对 BT 下载有效 240 | bt-hash-check-seed=true 241 | 242 | #加载已保存的元数据文件 243 | #当使用磁链下载时, 在从 DHT 获取种子元数据之前, 首先尝试加载使用 --bt-save-metadata 选项保存的文件. 如果文件加载成功, 则不会从 DHT 下载元数据. 244 | bt-load-saved-metadata=false 245 | 246 | #最多打开文件数 247 | #设置 BT/Metalink 下载全局打开的最大文件数. 248 | bt-max-open-files=100 249 | 250 | #最大连接节点数 251 | #设置每个 BT 下载的最大连接节点数. 0 表示不限制. 252 | bt-max-peers=55 253 | 254 | #仅下载种子文件 255 | #仅下载种子文件. 种子文件中描述的文件将不会下载. 此选项仅对磁链生效. 256 | bt-metadata-only=false 257 | 258 | #最低加密级别 259 | #设置加密方法的最小级别. 如果节点提供多种加密方法, aria2 将选择满足给定级别的最低级别. 260 | bt-min-crypto-level=plain 261 | 262 | #优先下载 263 | #尝试先下载每个文件开头或结尾的分片. 此选项有助于预览文件. 参数可以包括两个关键词: head 和 tail. 如果包含两个关键词, 需要使用逗号分隔. 每个关键词可以包含一个参数, SIZE. 例如, 如果指定 head=SIZE, 每个文件的最前 SIZE 数据将会获得更高的优先级. tail=SIZE 表示每个文件的最后 SIZE 数据. SIZE 可以包含 K 或 M (1K = 1024, 1M = 1024K). 264 | bt-prioritize-piece= 265 | 266 | #删除未选择的文件 267 | #当 BT 任务完成后删除未选择的文件. 要选择需要下载的文件, 请使用 --select-file 选项. 如果没有选择, 则所有文件都默认为需要下载. 此选项会从磁盘上直接删除文件, 请谨慎使用此选项. 268 | bt-remove-unselected-file=false 269 | 270 | #需要加密 271 | #如果设置为"是", aria 将不会接受以前的 BitTorrent 握手协议(\\19BitTorrent 协议)并建立连接. 因此 aria2 总是模糊握手. 272 | bt-require-crypto=false 273 | 274 | #期望下载速度 275 | #如果一个 BT 下载的整体下载速度低于此选项设置的值, aria2 会临时提高连接数以提高下载速度. 在某些情况下, 设置期望下载速度可以提高您的下载速度. 您可以增加数值的单位 K 或 M (1K = 1024, 1M = 1024K). 276 | bt-request-peer-speed-limit=50K 277 | 278 | #保存种子文件 279 | #保存种子文件为 ".torrent" 文件. 此选项仅对磁链生效. 文件名为十六进制编码后的哈希值及 ".torrent"后缀. 保存的目录与下载文件的目录相同. 如果相同的文件已存在, 种子文件将不会保存. 280 | bt-save-metadata=false 281 | 282 | #不检查已经下载的文件 283 | #不检查之前下载文件中每个分片的哈希值. 284 | bt-seed-unverified=false 285 | 286 | #无速度时自动停止时间 287 | #当 BT 任务F下载速度持续为 0, 达到此选项设置的时间后停止下载. 如果设置为 0, 此功能将禁用. 288 | bt-stop-timeout=0 289 | 290 | #BT 服务器地址 291 | #逗号分隔的 BT 服务器地址. 如果服务器地址在 --bt-exclude-tracker 选项中, 其将不会生效. 292 | bt-tracker= 293 | 294 | #BT 服务器连接超时时间 295 | #设置 BT 服务器的连接超时时间 (秒). 当连接建立后, 此选项不再生效, 请使用 --bt-tracker-timeout 选项. 296 | bt-tracker-connect-timeout=60 297 | 298 | #BT 服务器连接间隔时间 299 | #设置请求 BT 服务器的间隔时间 (秒). 此选项将完全覆盖服务器返回的最小间隔时间和间隔时间, aria2 仅使用此选项的值.如果设置为 0, aria2 将根据服务器的响应情况和下载进程决定时间间隔. 300 | bt-tracker-interval=0 301 | 302 | #BT 服务器超时时间 303 | bt-tracker-timeout=60 304 | 305 | #DHT (IPv4) 文件 306 | #修改 IPv4 DHT 路由表文件路径. 307 | dht-file-path=$HOME/.aria2/dht.dat 308 | 309 | #DHT (IPv6) 文件 310 | #修改 IPv6 DHT 路由表文件路径. 311 | dht-file-path6=$HOME/.aria2/dht6.dat 312 | 313 | #DHT 监听端口 314 | #设置 DHT (IPv4, IPv6) 和 UDP 服务器使用的 UCP 端口. 多个端口可以使用逗号 "," 分隔, 例如: 6881,6885. 您还可以使用短横线 "-" 表示范围: 6881-6999, 或可以一起使用: 6881-6889, 6999. 315 | dht-listen-port=6881-6999 316 | 317 | #DHT 消息超时时间 318 | dht-message-timeout=10 319 | 320 | #启用 DHT (IPv4) 321 | #启用 IPv4 DHT 功能. 此选项同时会启用 UDP 服务器支持. 如果种子设置为私有, 即使此选项设置为"是", aria2 也不会启用 DHT. 322 | enable-dht=true 323 | 324 | #启用 DHT (IPv6) 325 | #启用 IPv6 DHT 功能. 如果种子设置为私有, 即使此选项设置为"是", aria2 也不会启用 DHT. 使用 --dht-listen-port 选项设置监听的端口. 326 | enable-dht6= 327 | 328 | #启用节点交换 329 | #启用节点交换扩展. 如果种子设置为私有, 即使此选项设置为"是", aria2 也不会启用此功能. 330 | enable-peer-exchange=true 331 | 332 | #下载种子中的文件 333 | #如果设置为"是"或"仅内存", 当后缀为 .torrent 或内容类型为 application/x-bittorrent 的文件下载完成时, aria2 将按种子文件读取并下载该文件中提到的文件. 如果设置为"仅内存", 该种子文件将不会写入到磁盘中, 而仅会存储在内存中. 如果设置为"否", 则 .torrent 文件会下载到磁盘中, 但不会按种子文件读取并且其中的文件不会进行下载. 334 | follow-torrent=true 335 | 336 | #监听端口 337 | #设置 BT 下载的 TCP 端口. 多个端口可以使用逗号 "," 分隔, 例如: 6881,6885. 您还可以使用短横线 "-" 表示范围: 6881-6999, 或可以一起使用: 6881-6889, 6999. 338 | listen-port=6881-6999 339 | 340 | #全局最大上传速度 341 | #设置全局最大上传速度 (字节/秒). 0 表示不限制. 您可以增加数值的单位 K 或 M (1K = 1024, 1M = 1024K). 342 | max-overall-upload-limit=0 343 | 344 | #最大上传速度 345 | #设置每个任务的最大上传速度 (字节/秒). 0 表示不限制. 您可以增加数值的单位 K 或 M (1K = 1024, 1M = 1024K). 346 | max-upload-limit=0 347 | 348 | #节点 ID 前缀 349 | #指定节点 ID 的前缀. BT 中节点 ID 长度为 20 字节. 如果超过 20 字节, 将仅使用前 20 字节. 如果少于 20 字节, 将在其后不足随机的数据保证为 20 字节. 350 | peer-id-prefix=A2-1-33-0- 351 | 352 | #Peer Agent 353 | #指定 BT 扩展握手期间用于节点客户端版本的字符串. 354 | peer-agent=aria2/1.33.0 355 | 356 | #最小分享率 357 | #指定分享率. 当分享率达到此选项设置的值时会完成做种. 强烈建议您将此选项设置为大于等于 1.0. 如果您想不限制分享比率, 可以设置为 0.0. 如果同时设置了 --seed-time 选项, 当任意一个条件满足时将停止做种. 358 | seed-ratio=1.0 359 | 360 | #最小做种时间 361 | #此选项设置为 0 时, 将在 BT 任务下载完成后不进行做种. 362 | seed-time= 363 | 364 | #下载 Metalink 中的文件 365 | #如果设置为"是"或"仅内存", 当后缀为 .meta4 或 .metalink 或内容类型为 application/metalink4+xml 或 application/metalink+xml 的文件下载完成时, aria2 将按 Metalink 文件读取并下载该文件中提到的文件. 如果设置为"仅内存", 该 Metalink 文件将不会写入到磁盘中, 而仅会存储在内存中. 如果设置为"否", 则 .metalink 文件会下载到磁盘中, 但不会按 Metalink 文件读取并且其中的文件不会进行下载. 366 | follow-metalink=true 367 | 368 | #基础 URI 369 | #指定基础 URI 以便解析本地磁盘中存储的 Metalink 文件里 metalink:url 和 metalink:metaurl 中的相对 URI 地址. 如果 URI 表示的为目录, 最后需要以 / 结尾. 370 | metalink-base-uri= 371 | 372 | #语言 373 | metalink-language= 374 | 375 | #首选服务器位置 376 | #首选服务器所在的位置. 可以使用逗号分隔的列表, 例如: jp,us. 377 | metalink-location= 378 | 379 | #操作系统 380 | #下载文件的操作系统. 381 | metalink-os= 382 | 383 | #版本号 384 | #下载文件的版本号. 385 | metalink-version= 386 | 387 | #首选使用协议 388 | #指定首选使用的协议. 可以设置为 http, https, ftp 或"无". 设置为"无"时禁用此选项. 389 | metalink-preferred-protocol=none 390 | 391 | #仅使用唯一协议 392 | #如果一个 Metalink 文件可用多种协议, 并且此选项设置为"是", aria2 将只会使用其中一种. 使用 --metalink-preferred-protocol 参数指定首选的协议. 393 | metalink-enable-unique-protocol=true 394 | 395 | #启用 JSON-RPC/XML-RPC 服务器 396 | enable-rpc=false 397 | 398 | #种子文件下载完后暂停 399 | #当种子文件下载完成后暂停后续的下载. 在 aria2 中有 3 种种子文件的下载类型: (1) 下载 .torrent 文件. (2) 通过磁链下载的种子文件. (3) 下载 Metalink 文件. 这些种子文件下载完后会根据文件内容继续进行下载. 此选项会暂停这些后续的下载. 此选项仅当 --enable-rpc 选项启用时生效. 400 | pause-metadata=false 401 | 402 | #接受所有远程请求 403 | #在 RPC 响应头增加 Access-Control-Allow-Origin 字段, 值为 * . 404 | rpc-allow-origin-all=false 405 | 406 | #在所有网卡上监听 407 | #在所有网络适配器上监听 JSON-RPC/XML-RPC 的请求, 如果设置为"否", 仅监听本地网络的请求. 408 | rpc-listen-all=false 409 | 410 | #监听端口 411 | rpc-listen-port=6800 412 | 413 | #最大请求大小 414 | #设置 JSON-RPC/XML-RPC 最大的请求大小. 如果 aria2 检测到请求超过设定的字节数, 会直接取消连接. 415 | rpc-max-request-size=2M 416 | 417 | #保存上传的种子文件 418 | #在 dir 选项设置的目录中保存上传的种子文件或 Metalink 文件. 文件名包括 SHA-1 哈希后的元数据和扩展名两部分. 对于种子文件, 扩展名为 '.torrent'. 对于 Metalink 为 '.meta4'. 如果此选项设置为"否", 通过 aria2.addTorrent() 或 aria2.addMetalink() 方法添加的下载将无法通过 --save-session 选项保存. 419 | rpc-save-upload-metadata=true 420 | 421 | #启用 SSL/TLS 422 | #RPC 将通过 SSL/TLS 加密传输. RPC 客户端需要使用 https 协议连接服务器. 对于 WebSocket 客户端, 使用 wss 协议. 使用 --rpc-certificate 和 --rpc-private-key 选项设置服务器的证书和私钥. 423 | rpc-secure= 424 | 425 | #允许覆盖 426 | #如果相应的控制文件不存在时从头重新下载文件. 参见 --auto-file-renaming 选项. 427 | allow-overwrite=false 428 | 429 | #允许分片大小变化 430 | #如果设置为"否", 当分片长度与控制文件中的不同时, aria2 将会中止下载. 如果设置为"是", 您可以继续, 但部分下载进度将会丢失. 431 | allow-piece-length-change=false 432 | 433 | #始终断点续传 434 | #始终断点续传. 如果设置为"是", aria2 始终尝试断点续传, 如果无法恢复, 则中止下载. 如果设置为"否", 对于不支持断点续传的 URI 或 aria2 遇到 N 个不支持断点续传的 URI (N 为 --max-resume-failure-tries 选项设置的值), aria2 会从头下载文件. 参见 --max-resume-failure-tries 参数. 435 | always-resume=true 436 | 437 | #异步 DNS 438 | async-dns=true 439 | 440 | #文件自动重命名 441 | #重新命名已经存在的文件. 此选项仅对 HTTP(S)/FTP 下载有效. 新的文件名后会在文件名后、扩展名 (如果有) 前追加句点和数字(1..9999). 442 | auto-file-renaming=true 443 | 444 | #自动保存间隔 445 | #每隔设置的秒数自动保存控制文件(*.aria2). 如果设置为 0, 下载期间控制文件不会自动保存. 不论设置的值为多少, aria2 会在任务结束时保存控制文件. 可以设置的值为 0 到 600. 446 | auto-save-interval=60 447 | 448 | #条件下载 449 | #仅当本地文件比远程文件旧时才进行下载. 此功能仅适用于 HTTP(S) 下载. 如果在 Metalink 中文件大小已经被指定则功能无法生效. 同时此功能还将忽略 Content-Disposition 响应头. 如果存在控制文件, 此选项将被忽略. 此功能通过 If-Modified-Since 请求头获取较新的文件. 当获取到本地文件的修改时间时, 此功能将使用用户提供的文件名 (参见 --out 选项), 如果没有指定 --out 选项则使用 URI 中的文件名. 为了覆盖已经存在的文件, 需要使用 --allow-overwrite 参数. 450 | conditional-get=false 451 | 452 | #配置文件路径 453 | conf-path=$HOME/.aria2/aria2.conf 454 | 455 | #控制台日志级别 456 | console-log-level=notice 457 | 458 | #使用 UTF-8 处理 Content-Disposition 459 | #处理 "Content-Disposition" 头中的字符串时使用 UTF-8 字符集来代替 ISO-8859-1, 例如, 文件名参数, 但不是扩展版本的文件名. 460 | content-disposition-default-utf8= 461 | 462 | #启用后台进程 463 | daemon=false 464 | 465 | #延迟加载 466 | #如果设置为"是", aria2 在启动时不会读取 --input-file 选项设置的文件中的所有 URI 地址, 而是会在之后需要时按需读取. 如果输入文件中包含大量要下载的 URI, 此选项可以减少内存的使用. 如果设置为"否", aria2 会在启动时读取所有的 URI. 当 -save-session 使用时将会禁用 --deferred-input 选项. 467 | deferred-input=false 468 | 469 | #禁用 IPv6 470 | disable-ipv6=false 471 | 472 | #磁盘缓存 473 | #启用磁盘缓存. 如果设置为 0, 将禁用磁盘缓存. 此功能将下载的数据缓存在内存中, 最多占用此选项设置的字节数. 缓存存储由 aria2 实例创建并对所有下载共享. 由于数据以较大的单位写入并按文件的偏移重新排序, 所以磁盘缓存的一个优点是减少磁盘的 I/O. 如果调用哈希检查时并且数据缓存在内存中时, 将不需要从磁盘中读取. 大小可以包含 K 或 M (1K = 1024, 1M = 1024K). 474 | disk-cache=16M 475 | 476 | #下载结果 477 | #此选项将修改下载结果的格式. 如果设置为"默认", 将打印 GID, 状态, 平均下载速度和路径/URI. 如果涉及多个文件, 仅打印第一个请求文件的路径/URI, 其余的将被忽略. 如果设置为"完整", 将打印 GID, 状态, 平均下载速度, 下载进度和路径/URI. 其中, 下载进度和路径/URI 将会每个文件打印一行. 如果设置为"隐藏", 下载结果将会隐藏. 478 | download-result=default 479 | 480 | #DSCP 481 | #为 QoS 设置 BT 上行 IP 包的 DSCP 值. 此参数仅设置 IP 包中 TOS 字段的 DSCP 位, 而不是整个字段. 如果您从 /usr/include/netinet/ip.h 得到的值, 需要除以 4 (否则值将不正确, 例如您的 CS1 类将会转为 CS4). 如果您从 RFC, 网络供应商的文档, 维基百科或其他来源采取常用的值, 可以直接使用. 482 | dscp= 483 | 484 | #最多打开的文件描述符 485 | #设置打开的文件描述符的软限制 (soft limit). 此选项仅当满足如下条件时开放: a. 系统支持它 (posix). b. 限制没有超过硬限制 (hard limit). c. 指定的限制比当前的软限制高. 这相当于设置 ulimit, 除了其不能降低限制. 此选项仅当系统支持 rlimit API 时有效. 486 | rlimit-nofile= 487 | 488 | #终端输出使用颜色 489 | enable-color=true 490 | 491 | #启用 MMap 492 | #内存中存放映射文件. 当文件空间没有预先分配至, 此选项无效. 参见 --file-allocation. 493 | enable-mmap=false 494 | 495 | #事件轮询方法 496 | #设置事件轮训的方法. 可选的值包括 epoll, kqueue, port, poll 和 select. 对于 epoll, kqueue, port 和 poll, 只有系统支持时才可用. 最新的 Linux 支持 epoll. 各种 *BSD 系统包括 Mac OS X 支持 kqueue. Open Solaris 支持 port. 默认值根据您使用的操作系统不同而不同. 497 | event-poll= 498 | 499 | #文件分配方法 500 | #指定文件分配方法. "无" 不会预先分配文件空间. "prealloc"会在下载开始前预先分配空间. 这将会根据文件的大小需要一定的时间. 如果您使用的是较新的文件系统, 例如 ext4 (带扩展支持), btrfs, xfs 或 NTFS (仅 MinGW 构建), "falloc" 是最好的选择. 其几乎可以瞬间分配大(数 GiB)文件. 不要在旧的文件系统, 例如 ext3 和 FAT32 上使用 falloc, 因为与 prealloc 花费的时间相同, 并且其会阻塞 aria2 知道分配完成. 当您的系统不支持 posix_fallocate(3) 函数时, falloc 可能无法使用. "trunc" 使用 ftruncate(2) 系统调用或平台特定的实现将文件截取到特定的长度. 在多文件的 BitTorrent 下载中, 若某文件与其相邻的文件共享相同的分片时, 则相邻的文件也会被分配. 501 | file-allocation=prealloc 502 | 503 | #强制保存 504 | #即使任务完成或删除时使用 --save-session 选项时也保存该任务. 此选项在这种情况下还会保存控制文件. 此选项可以保存被认为已经完成但正在做种的 BT 任务. 505 | force-save=false 506 | 507 | #保存未找到的文件 508 | #当使用 --save-session 选项时, 即使当任务中的文件不存在时也保存该下载任务. 此选项同时会将这种情况保存到控制文件中. 509 | save-not-found=true 510 | 511 | #仅哈希检查 512 | #如果设置为"是", 哈希检查完使用 --check-integrity 选项, 根据是否下载完成决定是否终止下载. 513 | hash-check-only=false 514 | 515 | #控制台可读输出 516 | #在控制台输出可读格式的大小和速度 (例如, 1.2Ki, 3.4Mi). 517 | human-readable=true 518 | 519 | #保留未完成的任务 520 | #保留所有未完成的下载结果, 即使超过了 --max-download-result 选项设置的数量. 这将有助于在会话文件中保存所有的未完成的下载 (参考 --save-session 选项). 需要注意的是, 未完成任务的数量没有上限. 如果不希望这样, 请关闭此选项. 521 | keep-unfinished-download-result=true 522 | 523 | #最多下载结果 524 | #设置内存中存储最多的下载结果数量. 下载结果包括已完成/错误/已删除的下载. 下载结果存储在一个先进先出的队列中, 因此其可以存储最多指定的下载结果的数量. 当队列已满且有新的下载结果创建时, 最老的下载结果将从队列的最前部移除, 新的将放在最后. 此选项设置较大的值后如果经过几千次的下载将导致较高的内存消耗. 设置为 0 表示不存储下载结果. 注意, 未完成的下载将始终保存在内存中, 不考虑该选项的设置. 参考 --keep-unfinished-download-result 选项. 525 | max-download-result=1000 526 | 527 | #MMap 最大限制 528 | #设置启用 MMap (参见 --enable-mmap 选项) 最大的文件大小. 文件大小由一个下载任务中所有文件大小的和决定. 例如, 如果一个下载包含 5 个文件, 那么文件大小就是这些文件的总大小. 如果文件大小超过此选项设置的大小时, MMap 将会禁用. 529 | max-mmap-limit=9223372036854775807 530 | 531 | #最大断点续传尝试次数 532 | #当 --always-resume 选项设置为"否"时, 如果 aria2 检测到有 N 个 URI 不支持断点续传时, 将从头开始下载文件. 如果 N 设置为 0, 当所有 URI 都不支持断点续传时才会从头下载文件. 参见 --always-resume 选项. 533 | max-resume-failure-tries=0 534 | 535 | #最低 TLS 版本 536 | #指定启用的最低 SSL/TLS 版本. 537 | min-tls-version=TLSv1 538 | 539 | #日志级别 540 | log-level=debug 541 | 542 | #优化并发下载 543 | #根据可用带宽优化并发下载的数量. aria2 使用之前统计的下载速度通过规则 N = A + B Log10 (速度单位为 Mbps) 得到并发下载的数量. 其中系数 A 和 B 可以在参数中以冒号分隔自定义. 默认值 (A=5, B=25) 可以在 1Mbps 网络上使用通常 5 个并发下载, 在 100Mbps 网络上为 50 个. 并发下载的数量保持在 --max-concurrent-downloads 参数定义的最大之下. 544 | optimize-concurrent-downloads=false 545 | 546 | #文件分片大小 547 | #设置 HTTP/FTP 下载的分配大小. aria2 根据这个边界分割文件. 所有的分割都是这个长度的倍数. 此选项不适用于 BitTorrent 下载. 如果 Metalink 文件中包含分片哈希的结果此选项也不适用. 548 | piece-length=1M 549 | 550 | #显示控制台输出 551 | show-console-readout=true 552 | 553 | #下载摘要输出间隔 554 | #设置下载进度摘要的输出间隔(秒). 设置为 0 禁止输出. 555 | summary-interval=60 556 | 557 | #全局最大下载速度 558 | #设置全局最大下载速度 (字节/秒). 0 表示不限制. 您可以增加数值的单位 K 或 M (1K = 1024, 1M = 1024K). 559 | max-overall-download-limit=0 560 | 561 | #最大下载速度 562 | #设置每个任务的最大下载速度 (字节/秒). 0 表示不限制. 您可以增加数值的单位 K 或 M (1K = 1024, 1M = 1024K). 563 | max-download-limit=0 564 | 565 | #禁用配置文件 566 | no-conf= 567 | 568 | #文件分配限制 569 | #不对比此参数设置大小小的分配文件. 您可以增加数值的单位 K 或 M (1K = 1024, 1M = 1024K). 570 | no-file-allocation-limit=5M 571 | 572 | #启用参数化 URI 支持 573 | #启用参数化 URI 支持. 您可以指定部分的集合: http://{sv1,sv2,sv3}/foo.iso. 同时您也可以使用步进计数器指定数字化的序列: http://host/image[000-100:2].img. 步进计数器可以省略. 如果所有 URI 地址不指向同样的文件, 例如上述第二个示例, 需要使用 -Z 选项. 574 | parameterized-uri=false 575 | 576 | #禁用控制台输出 577 | quiet=false 578 | 579 | #实时数据块验证 580 | #如果提供了数据块的校验和, 将在下载过程中通过校验和验证数据块. 581 | realtime-chunk-checksum=true 582 | 583 | #删除控制文件 584 | #在下载前删除控制文件. 使用 --allow-overwrite=true 选项时, 总是从头开始下载文件. 此选项将有助于使用不支持断点续传代理服务器的用户. 585 | remove-control-file= 586 | 587 | #状态保存文件 588 | #当退出时保存错误及未完成的任务到指定的文件中. 您可以在重启 aria2 时使用 --input-file 选项重新加载. 如果您希望输出的内容使用 GZip 压缩, 您可以在文件名后增加 .gz 扩展名. 请注意, 通过 aria2.addTorrent() 和 aria2.addMetalink() RPC 方法添加的下载, 其元数据没有保存到文件的将不会保存. 通过 aria2.remove() 和 aria2.forceRemove() 删除的下载将不会保存. 589 | save-session= 590 | 591 | #保存状态间隔 592 | #每隔此选项设置的时间(秒)后会保存错误或未完成的任务到 --save-session 选项指定的文件中. 如果设置为 0, 仅当 aria2 退出时才会保存. 593 | save-session-interval=0 594 | 595 | #Socket 接收缓冲区大小 596 | #设置 Socket 接收缓冲区最大的字节数. 指定为 0 时将禁用此选项. 当使用 SO_RCVBUF 选项调用 setsockopt() 时此选项的值将设置到 Socket 的文件描述符中. 597 | socket-recv-buffer-size=0 598 | 599 | #自动关闭时间 600 | #在此选项设置的时间(秒)后关闭应用. 如果设置为 0, 此功能将禁用. 601 | stop=0 602 | 603 | #缩短控制台输出内容 604 | #缩短控制台输出的内容在一行中. 605 | truncate-console-readout=true 606 | 607 | #部分事件hook 608 | #BT下载完成(如有做种将包含做种,如需调用请务必确定设定完成做种条件) 609 | on-bt-download-complete= 610 | #下载完成 611 | on-download-complete= 612 | #下载错误 613 | on-download-error= 614 | #下载暂停 615 | on-download-pause= 616 | #下载开始 617 | on-download-start= 618 | #下载停止 619 | on-download-stop= 620 | ``` -------------------------------------------------------------------------------- /aria2/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/aria2 . 3 | -------------------------------------------------------------------------------- /civetweb/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make 4 | RUN wget -O- https://github.com/civetweb/civetweb/archive/v1.16.tar.gz | tar xz && \ 5 | cd civetweb-* && make -j4 COPT="-Os -ffunction-sections -fdata-sections" LDFLAGS="-static" WITH_LUA=1 WITH_WEBSOCKET=1 WITH_SERVER_STATS=1 WITH_DUKTAPE_VERSION=108 WITH_IPV6=1 && \ 6 | strip -s civetweb && mv civetweb / 7 | 8 | FROM alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /civetweb /usr/local/bin/ 11 | EXPOSE 8080 12 | CMD [ "civetweb" ] 13 | 14 | -------------------------------------------------------------------------------- /civetweb/README.MD: -------------------------------------------------------------------------------- 1 | 2 | 3 | ``` 4 | docker run --rm -it -v /data/web:/www suconghou/civetweb civetweb -document_root /www 5 | ``` 6 | 7 | `/etc/systemd/system/civetweb.service` 8 | ``` 9 | [Unit] 10 | Description=civetweb service 11 | After=network.target network-online.target 12 | 13 | [Service] 14 | Restart=on-failure 15 | TimeoutStartSec=0 16 | ExecStart=/usr/local/bin/civetweb -document_root /data/www/lua -enable_directory_listing no -cgi_timeout_ms 5000 -error_log_file /dev/stderr 17 | 18 | [Install] 19 | WantedBy=multi-user.target 20 | ``` 21 | `sudo systemctl daemon-reload` 22 | `sudo systemctl enable civetweb` 23 | `sudo systemctl start civetweb` 24 | -------------------------------------------------------------------------------- /civetweb/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/civetweb . 3 | 4 | -------------------------------------------------------------------------------- /dnscrypt/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN wget -O- https://github.com/DNSCrypt/dnscrypt-proxy/releases/download/2.0.27/dnscrypt-proxy-linux_x86_64-2.0.27.tar.gz | tar xz --strip 1 3 | 4 | FROM alpine 5 | LABEL maintainer="suconghou@gmail.com" 6 | RUN apk add --update --no-cache ca-certificates 7 | COPY --from=build /dnscrypt-proxy /usr/local/bin/ 8 | ADD dnscrypt-proxy.toml /etc/ 9 | CMD ["dnscrypt-proxy","-config","/etc/dnscrypt-proxy.toml"] 10 | -------------------------------------------------------------------------------- /dnscrypt/README.MD: -------------------------------------------------------------------------------- 1 | ## dnscrypt 2 | 3 | https://github.com/jedisct1/dnscrypt-proxy 4 | 5 | **usage** 6 | 7 | ``` 8 | docker run \ 9 | -d \ 10 | -m 20m \ 11 | --restart always \ 12 | --name dnscrypt-proxy \ 13 | -p 192.168.0.5:53:53/tcp \ 14 | -p 192.168.0.5:53:53/udp \ 15 | suconghou/dnscrypt-proxy 16 | ``` 17 | 18 | 19 | ## dockerfile 20 | 21 | https://github.com/suconghou/docker/tree/master/influxdb 22 | 23 | 24 | docker image https://hub.docker.com/r/suconghou/influxdb/ 25 | 26 | -------------------------------------------------------------------------------- /dnscrypt/dnscrypt-proxy.toml: -------------------------------------------------------------------------------- 1 | 2 | listen_addresses = ['0.0.0.0:53'] 3 | 4 | max_clients = 250 5 | 6 | ipv4_servers = true 7 | 8 | ipv6_servers = false 9 | 10 | dnscrypt_servers = true 11 | 12 | doh_servers = true 13 | 14 | 15 | require_dnssec = false 16 | 17 | require_nolog = true 18 | 19 | require_nofilter = true 20 | 21 | force_tcp = false 22 | 23 | timeout = 2500 24 | 25 | keepalive = 30 26 | 27 | lb_strategy = 'fastest' 28 | 29 | use_syslog = false 30 | 31 | cert_refresh_delay = 240 32 | 33 | fallback_resolver = '114.114.114.114:53' 34 | ignore_system_dns = false 35 | 36 | 37 | netprobe_timeout = 30 38 | log_files_max_size = 10 39 | 40 | log_files_max_age = 7 41 | 42 | log_files_max_backups = 1 43 | 44 | block_ipv6 = true 45 | 46 | cache = true 47 | 48 | cache_size = 512 49 | 50 | cache_min_ttl = 600 51 | 52 | cache_max_ttl = 86400 53 | 54 | cache_neg_min_ttl = 60 55 | 56 | cache_neg_max_ttl = 600 57 | 58 | [query_log] 59 | 60 | 61 | file = 'query.log' 62 | 63 | format = 'tsv' 64 | 65 | [nx_log] 66 | 67 | file = 'nx.log' 68 | 69 | format = 'tsv' 70 | 71 | [blacklist] 72 | 73 | [ip_blacklist] 74 | 75 | [whitelist] 76 | 77 | [schedules] 78 | 79 | [sources] 80 | 81 | [static] 82 | [static.'dns.rubyfish.cn'] 83 | stamp = 'sdns://AgcAAAAAAAAAAAAPZG5zLnJ1YnlmaXNoLmNuCi9kbnMtcXVlcnk' 84 | 85 | -------------------------------------------------------------------------------- /dnscrypt/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/dnscrypt-proxy . 3 | -------------------------------------------------------------------------------- /dnsforwarder/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make 3 | RUN wget -O- https://github.com/holmium/dnsforwarder/archive/6.1.15.tar.gz | tar xz && \ 4 | cd dnsforwarder-* && \ 5 | ./configure --enable-downloader=wget && \ 6 | make -j2 CFLAGS=-Os LDFLAGS=-static && make install && \ 7 | strip -s /usr/local/bin/dnsforwarder 8 | 9 | FROM alpine 10 | LABEL maintainer="suconghou@gmail.com" 11 | COPY --from=build /usr/local/bin/dnsforwarder /usr/local/bin/dnsforwarder 12 | -------------------------------------------------------------------------------- /dnsforwarder/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/dnsforwarder . 3 | 4 | -------------------------------------------------------------------------------- /ffmpeg/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu 2 | 3 | RUN apt install yasm nasm 4 | 5 | 6 | RUN PREFIX="/tmp/linux" SRC="/tmp/src" && \ 7 | PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig" && \ 8 | # url start 9 | BZIP2_URL=https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz && \ 10 | ZLIB_URL=http://zlib.net/zlib-1.2.11.tar.xz && \ 11 | XZ_URL=https://tukaani.org/xz/xz-5.2.5.tar.xz && \ 12 | X264_URL=http://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20191217-2245.tar.bz2 && \ 13 | OPUS_URL=https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz && \ 14 | WEBP_URL=http://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.2.tar.gz && \ 15 | VPX_URL=https://github.com/webmproject/libvpx/archive/refs/tags/v1.11.0.tar.gz && \ 16 | FFMPEG_URL=http://ffmpeg.org/releases/ffmpeg-5.0.tar.xz && \ 17 | # url end 18 | mkdir -p $PREFIX $SRC && \ 19 | # bzip2 20 | rm -rf $SRC/bzip2 && mkdir $SRC/bzip2 && \ 21 | wget -O- $BZIP2_URL | tar xz --strip 1 -C $SRC/bzip2 && \ 22 | cd $SRC/bzip2 && \ 23 | make -j4 && make install PREFIX=$PREFIX && \ 24 | # zlib 25 | rm -rf $SRC/zlib && mkdir $SRC/zlib && \ 26 | wget -O- $ZLIB_URL | tar xJ --strip 1 -C $SRC/zlib && \ 27 | cd $SRC/zlib && \ 28 | ./configure --prefix=$PREFIX --static && \ 29 | make -j4 && make install && \ 30 | #lzma 31 | rm -rf $SRC/xz && mkdir $SRC/xz && \ 32 | wget -O- $XZ_URL | tar xJ --strip 1 -C $SRC/xz && \ 33 | cd $SRC/xz && \ 34 | ./configure --prefix=$PREFIX --enable-static --enable-shared=no && \ 35 | make -j4 && make install && \ 36 | # x264 37 | rm -rf $SRC/x264 && mkdir $SRC/x264 && \ 38 | wget -O- $X264_URL | tar xj --strip 1 -C $SRC/x264 && \ 39 | cd $SRC/x264 && \ 40 | ./configure --prefix=$PREFIX --enable-static --enable-pic --disable-cli && \ 41 | make -j4 && make install && \ 42 | # opus 43 | rm -rf $SRC/opus && mkdir $SRC/opus && \ 44 | wget -O- $OPUS_URL | tar xz --strip 1 -C $SRC/opus && \ 45 | cd $SRC/opus && \ 46 | ./configure --prefix=$PREFIX --enable-shared=no && \ 47 | make -j4 && make install && \ 48 | # vpx 49 | rm -rf $SRC/vpx && mkdir $SRC/vpx && \ 50 | wget -O- $VPX_URL | tar xz --strip 1 -C $SRC/vpx && \ 51 | cd $SRC/vpx && \ 52 | ./configure --prefix=$PREFIX --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --enable-pic --disable-debug --disable-examples --disable-docs --disable-install-bins && \ 53 | make -j4 && make install && \ 54 | # webp 55 | rm -rf $SRC/webp && mkdir $SRC/webp && \ 56 | wget -O- $WEBP_URL | tar xz --strip 1 -C $SRC/webp && \ 57 | cd $SRC/webp && \ 58 | ./configure --prefix=$PREFIX --enable-shared=no && \ 59 | make -j4 && make install && \ 60 | # ffmpeg 61 | rm -rf $SRC/ffmpeg && mkdir $SRC/ffmpeg && \ 62 | wget -O- $FFMPEG_URL | tar xJ --strip 1 -C $SRC/ffmpeg && \ 63 | cd $SRC/ffmpeg && \ 64 | ./configure --prefix=$PREFIX --extra-cflags="-I${PREFIX}/include" --extra-ldflags="-L${PREFIX}/lib" \ 65 | --extra-libs=-lm \ 66 | --disable-doc --disable-programs --enable-nonfree --enable-gpl \ 67 | --enable-libopus --enable-libx264 --enable-libvpx --enable-libwebp && \ 68 | make -j4 && make install 69 | 70 | -------------------------------------------------------------------------------- /ffmpeg/Dockerfile-bin: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | COPY --from=mwader/static-ffmpeg:8.0 /ffmpeg /usr/local/bin/ 3 | COPY --from=mwader/static-ffmpeg:8.0 /ffprobe /usr/local/bin/ 4 | -------------------------------------------------------------------------------- /ffmpeg/README.MD: -------------------------------------------------------------------------------- 1 | build ffmpeg static libs for development -------------------------------------------------------------------------------- /fluent/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | RUN yum install -y gcc make wget tar gcc-c++ flex bison openssl-devel postgresql-devel 3 | RUN yum install -y https://download-ib01.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 4 | RUN yum install -y cmake3 5 | RUN wget -O- https://github.com/fluent/fluent-bit/archive/refs/tags/v2.0.9.tar.gz | tar xz --strip 1 6 | RUN ln -s /usr/bin/sh /bin/sh 7 | RUN cd build && \ 8 | cmake3 -DFLB_ALL=OFF \ 9 | -DFLB_RELEASE=On \ 10 | -DFLB_JEMALLOC=On \ 11 | -DFLB_STREAM_PROCESSOR=Off \ 12 | -DFLB_TLS=On \ 13 | -DFLB_AWS=OFF \ 14 | -DFLB_SHARED_LIB=Off \ 15 | -DFLB_EXAMPLES=Off \ 16 | -DFLB_RECORD_ACCESSOR=On \ 17 | -DFLB_IN_SYSTEMD=Off \ 18 | -DFLB_HTTP_SERVER=On \ 19 | -DFLB_POSIX_TLS=Off \ 20 | -DFLB_CONFIG_YAML=Off \ 21 | -DFLB_SIGNV4=Off \ 22 | -DFLB_WASM=Off \ 23 | -DFLB_LUAJIT=Off \ 24 | -DFLB_PROXY_GO=Off \ 25 | -DFLB_CUSTOM_CALYPTIA=OFF \ 26 | -DFLB_CHUNK_TRACE=OFF \ 27 | \ 28 | -DFLB_IN_COLLECTD=Off \ 29 | -DFLB_IN_CPU=Off \ 30 | -DFLB_IN_DISK=Off \ 31 | -DFLB_IN_DOCKER=Off \ 32 | -DFLB_IN_EXEC=Off \ 33 | -DFLB_IN_EXEC_WASI=Off \ 34 | -DFLB_IN_FLUENTBIT_METRICS=Off \ 35 | -DFLB_IN_FORWARD=Off \ 36 | -DFLB_IN_HEAD=Off \ 37 | -DFLB_IN_HEALTH=Off \ 38 | -DFLB_IN_KMSG=Off \ 39 | -DFLB_IN_MEM=Off \ 40 | -DFLB_IN_MQTT=Off \ 41 | -DFLB_IN_NETIF=Off \ 42 | -DFLB_IN_PROC=Off \ 43 | -DFLB_IN_RANDOM=Off \ 44 | -DFLB_IN_SERIAL=Off \ 45 | -DFLB_IN_STDIN=Off \ 46 | -DFLB_IN_SYSLOG=Off \ 47 | -DFLB_IN_SYSTEMD=Off \ 48 | -DFLB_IN_TAIL=On \ 49 | -DFLB_IN_TCP=Off \ 50 | -DFLB_IN_THERMAL=Off \ 51 | -DFLB_IN_WINLOG=Off \ 52 | -DFLB_IN_WINEVTLOG=Off \ 53 | -DFLB_IN_NODE_EXPORTER_METRICS=Off \ 54 | -DFLB_IN_DOCKER_EVENTS=Off \ 55 | -DFLB_IN_PROMETHEUS_SCRAPE=OFF \ 56 | -DFLB_IN_OPENTELEMETRY=OFF \ 57 | -DFLB_IN_STORAGE_BACKLOG=Off \ 58 | -DFLB_IN_HTTP=OFF \ 59 | -DFLB_IN_STATSD=OFF \ 60 | -DFLB_IN_EVENT_TEST=OFF \ 61 | -DFLB_IN_EVENT_TYPE=OFF \ 62 | -DFLB_IN_EMITTER=OFF \ 63 | \ 64 | -DFLB_FILTER_AWS=Off \ 65 | -DFLB_FILTER_ECS=Off \ 66 | -DFLB_FILTER_EXPECT=Off \ 67 | -DFLB_FILTER_GREP=Off \ 68 | -DFLB_FILTER_KUBERNETES=Off \ 69 | -DFLB_FILTER_LUA=Off \ 70 | -DFLB_FILTER_MODIFY=Off \ 71 | -DFLB_FILTER_NEST=Off \ 72 | -DFLB_FILTER_PARSER=Off \ 73 | -DFLB_FILTER_RECORD_MODIFIER=Off \ 74 | -DFLB_FILTER_REWRITE_TAG=Off \ 75 | -DFLB_FILTER_STDOUT=Off \ 76 | -DFLB_FILTER_THROTTLE=Off \ 77 | -DFLB_FILTER_WASM=Off \ 78 | -DFLB_FILTER_TYPE_CONVERTER=Off \ 79 | -DFLB_FILTER_NIGHTFALL=Off \ 80 | -DFLB_FILTER_GEOIP2=OFF \ 81 | -DFLB_FILTER_CHECKLIST=OFF \ 82 | -DFLB_FILTER_ALTER_SIZE=OFF \ 83 | -DFLB_FILTER_MULTILINE=OFF \ 84 | \ 85 | -DFLB_OUT_AZURE=Off \ 86 | -DFLB_OUT_AZURE_KUSTO=Off \ 87 | -DFLB_OUT_AZURE_BLOB=OFF \ 88 | -DFLB_OUT_BIGQUERY=Off \ 89 | -DFLB_OUT_COUNTER=Off \ 90 | -DFLB_OUT_CLOUDWATCH_LOGS=Off \ 91 | -DFLB_OUT_DATADOG=Off \ 92 | -DFLB_OUT_ES=Off \ 93 | -DFLB_OUT_FILE=Off \ 94 | -DFLB_OUT_KINESIS_FIREHOSE=Off \ 95 | -DFLB_OUT_KINESIS_STREAMS=Off \ 96 | -DFLB_OUT_FLOWCOUNTER=Off \ 97 | -DFLB_OUT_FORWARD=Off \ 98 | -DFLB_OUT_GELF=Off \ 99 | -DFLB_OUT_HTTP=Off \ 100 | -DFLB_OUT_INFLUXDB=Off \ 101 | -DFLB_OUT_KAFKA=Off \ 102 | -DFLB_OUT_KAFKA_REST=Off \ 103 | -DFLB_OUT_LIB=Off \ 104 | -DFLB_OUT_NATS=Off \ 105 | -DFLB_OUT_NULL=Off \ 106 | -DFLB_OUT_PGSQL=On \ 107 | -DFLB_OUT_PLOT=Off \ 108 | -DFLB_OUT_SLACK=Off \ 109 | -DFLB_OUT_S3=Off \ 110 | -DFLB_OUT_SPLUNK=Off \ 111 | -DFLB_OUT_STACKDRIVER=Off \ 112 | -DFLB_OUT_STDOUT=On \ 113 | -DFLB_OUT_TCP=Off \ 114 | -DFLB_OUT_TD=Off \ 115 | -DFLB_OUT_LOKI=Off \ 116 | -DFLB_OUT_OPENSEARCH=Off \ 117 | -DFLB_OUT_PROMETHEUS_EXPORTER=Off \ 118 | -DFLB_OUT_PROMETHEUS_REMOTE_WRITE=OFF \ 119 | -DFLB_OUT_SKYWALKING=OFF \ 120 | -DFLB_OUT_LOGDNA=OFF \ 121 | -DFLB_OUT_NRLOGS=OFF \ 122 | -DFLB_OUT_OPENTELEMETRY=OFF \ 123 | -DFLB_OUT_CALYPTIA=OFF \ 124 | -DFLB_OUT_WEBSOCKET=OFF \ 125 | -DFLB_OUT_SYSLOG=OFF \ 126 | \ 127 | .. && \ 128 | \ 129 | make -j4 && \ 130 | make install && \ 131 | strip -s /usr/local/bin/fluent-bit 132 | 133 | 134 | FROM centos:7 135 | LABEL maintainer="suconghou@gmail.com" 136 | COPY --from=build /usr/local/bin/fluent-bit /usr/local/bin/fluent-bit 137 | COPY --from=build /usr/local/etc/fluent-bit/fluent-bit.conf /usr/local/etc/fluent-bit/fluent-bit.conf 138 | COPY --from=build /usr/local/etc/fluent-bit/parsers.conf /usr/local/etc/fluent-bit/parsers.conf 139 | -------------------------------------------------------------------------------- /ftp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update wget make gcc g++ zlib-dev zlib-static 3 | RUN BFTPD_VERSION=bftpd-5.7 && wget --no-check-certificate https://jaist.dl.sourceforge.net/project/bftpd/bftpd/${BFTPD_VERSION}/${BFTPD_VERSION}.tar.gz && tar zxf ${BFTPD_VERSION}.tar.gz && cd bftpd && ls -lha && \ 4 | export CFLAGS="-ffunction-sections -fdata-sections -Os" && \ 5 | LIBS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" ./configure --enable-libz && \ 6 | sed -i "s{-o bftpd{-static -o bftpd{" Makefile && make -j2 && strip -s bftpd 7 | 8 | FROM alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /bftpd/bftpd /usr/local/bin/bftpd 11 | -------------------------------------------------------------------------------- /ftp/Dockerfile-vsftpd: -------------------------------------------------------------------------------- 1 | FROM debian AS build 2 | RUN apt update -y && apt install wget cmake gcc g++ glibc-source -y 3 | RUN VSFTPD_VERSION=vsftpd-3.0.3 && wget --no-check-certificate https://security.appspot.com/downloads/${VSFTPD_VERSION}.tar.gz && tar zxf ${VSFTPD_VERSION}.tar.gz && cd ${VSFTPD_VERSION} && ls -lha && \ 4 | make LDFLAGS=-static && strip -s vsftpd && ls -lh vsftpd && mv vsftpd / 5 | 6 | 7 | FROM alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /vsftpd /usr/local/bin/vsftpd 10 | -------------------------------------------------------------------------------- /ftp/README.MD: -------------------------------------------------------------------------------- 1 | ## bftpd 2 | 3 | http://bftpd.sourceforge.net/ 4 | 5 | 6 | run without config file (use default settings) `bftpd -n -D`, default port is 21 7 | 8 | config file 9 | ``` 10 | global{ 11 | PORT="8855" 12 | LOGFILE="/tmp/1.log" 13 | ROOTDIR="/tmp/" 14 | } 15 | ``` 16 | 17 | 18 | ## vsftpd 19 | 20 | https://security.appspot.com/vsftpd.html#download 21 | 22 | version 3.0.3 23 | 24 | static build vsftpd on debian9 25 | 26 | 27 | ## dockerfile 28 | 29 | https://github.com/suconghou/docker/tree/master/ftp 30 | 31 | 32 | docker image https://hub.docker.com/r/suconghou/ftp/ 33 | 34 | -------------------------------------------------------------------------------- /ftp/make-vsftpd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/ftp:vsftpd -t=suconghou/ftp:vsftpd-3.0.3 . -f Dockerfile-vsftpd 3 | -------------------------------------------------------------------------------- /ftp/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/ftp -t=suconghou/ftp:bftpd-5.7 . 3 | -------------------------------------------------------------------------------- /goproxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add binutils && \ 3 | wget -O- https://github.com/snail007/goproxy/releases/download/v6.5/proxy-linux-amd64.tar.gz | tar xz && \ 4 | strip -s proxy 5 | 6 | FROM alpine 7 | LABEL maintainer="suconghou@gmail.com" 8 | COPY --from=build /proxy /usr/local/bin/ 9 | COPY --from=build /direct /blocked /etc/ 10 | -------------------------------------------------------------------------------- /goproxy/README.MD: -------------------------------------------------------------------------------- 1 | ## goproxy 2 | 3 | 4 | socks 5 | ``` 6 | proxy socks -p "0.0.0.0:8090" -T tcp -P "22.22.22.22:8080" -b /etc/blocked -d /etc/direct 7 | ``` 8 | -------------------------------------------------------------------------------- /goproxy/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/goproxy . 3 | 4 | -------------------------------------------------------------------------------- /haproxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make wget linux-headers pcre-dev zlib-dev zlib-static openssl-dev openssl-libs-static libexecinfo-dev 4 | RUN HAPROXY_VERSION=haproxy-2.5.6 && wget --no-check-certificate https://www.haproxy.org/download/2.5/src/${HAPROXY_VERSION}.tar.gz && tar zxf ${HAPROXY_VERSION}.tar.gz && cd ${HAPROXY_VERSION} && ls -lha 5 | RUN cd haproxy-* && rm /usr/lib/libc.so && make TARGET=linux-musl ARCH=X86_64 USE_OPENSSL=1 USE_STATIC_PCRE=1 USE_PCRE_JIT=1 USE_ZLIB=1 LDFLAGS="-s -static" -j4 && make install && strip -s /usr/local/sbin/haproxy 6 | 7 | FROM alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /usr/local/sbin/haproxy /usr/local/sbin/haproxy 10 | -------------------------------------------------------------------------------- /haproxy/Dockerfile-2.4: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make wget linux-headers pcre-dev zlib-dev zlib-static openssl-dev openssl-libs-static libexecinfo-dev 4 | RUN HAPROXY_VERSION=haproxy-2.4.16 && wget --no-check-certificate https://www.haproxy.org/download/2.4/src/${HAPROXY_VERSION}.tar.gz && tar zxf ${HAPROXY_VERSION}.tar.gz && cd ${HAPROXY_VERSION} && ls -lha 5 | RUN cd haproxy-* && rm /usr/lib/libc.so && make TARGET=linux-musl ARCH=X86_64 USE_OPENSSL=1 USE_STATIC_PCRE=1 USE_PCRE_JIT=1 USE_ZLIB=1 LDFLAGS="-s -static" -j4 && make install && strip -s /usr/local/sbin/haproxy 6 | 7 | 8 | FROM alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /usr/local/sbin/haproxy /usr/local/sbin/haproxy 11 | -------------------------------------------------------------------------------- /haproxy/README.MD: -------------------------------------------------------------------------------- 1 | ## Haproxy 2 | 3 | haproxy docker image 4 | 5 | static build haproxy 6 | 7 | haproxy version 2.5.6 8 | 9 | haproxy source code release here http://www.haproxy.org/#down 10 | 11 | ## Dockerfile 12 | 13 | https://github.com/suconghou/docker/tree/master/haproxy 14 | 15 | docker image https://hub.docker.com/r/suconghou/haproxy/ 16 | 17 | static build 18 | 19 | ``` 20 | make TARGET=linux2628 ARCH=X86_64 USE_STATIC_PCRE=1 USE_PCRE_JIT=1 USE_ZLIB=1 LDFLAGS="-static" CFLAGS="-O3" ADDLIB="/usr/lib/libc.a" -j2 21 | ``` 22 | 23 | 在 busybox 系统中运行时没有nobody组,可以 `addgroup nobody`添加该组 24 | https://www.cnblogs.com/mcsiberiawolf/articles/10796014.html 25 | -------------------------------------------------------------------------------- /haproxy/make-2.4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/haproxy:2.4.16 . -f Dockerfile-2.4 -------------------------------------------------------------------------------- /haproxy/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/haproxy -t=suconghou/haproxy:2.5.6 . -------------------------------------------------------------------------------- /http/darkhttpd: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ wget 3 | RUN wget --no-check-certificate https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2 && tar jxf darkhttpd-1.12.tar.bz2 && cd darkhttpd-1.12 && \ 4 | gcc -Os -static -o /darkhttpd darkhttpd.c && strip -s /darkhttpd 5 | 6 | FROM scratch 7 | LABEL maintainer="suconghou@gmail.com" 8 | COPY --from=build /darkhttpd /darkhttpd 9 | ENTRYPOINT ["/darkhttpd"] 10 | EXPOSE 80 11 | 12 | -------------------------------------------------------------------------------- /http/make-darkhttpd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build --add-host unix4lyfe.org:192.243.115.210 -t=suconghou/http:darkhttpd -f darkhttpd . 3 | -------------------------------------------------------------------------------- /influxdb/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update binutils 3 | RUN wget -O- https://dl.influxdata.com/influxdb/releases/influxdb-1.8.0-static_linux_amd64.tar.gz | tar xz --strip 2 && \ 4 | strip -s influxd influx && \ 5 | /influxd config > /influxdb.conf && \ 6 | sed -i 's/auth-enabled.*/auth-enabled = true/g' /influxdb.conf && \ 7 | sed -i 's/reporting-disabled.*/reporting-disabled = true/g' /influxdb.conf && \ 8 | sed -i 's/wal-fsync-delay.*/wal-fsync-delay = "200ms"/g' /influxdb.conf && \ 9 | sed -i 's/index-version.*/index-version = "tsi1"/g' /influxdb.conf && \ 10 | sed -i 's/cache-max-memory-size.*/cache-max-memory-size = 268435456/g' /influxdb.conf && \ 11 | sed -i 's/\/root\/.influxdb\//\/influxdb\//g' /influxdb.conf && \ 12 | sed -i 's/bind-address = ":8086"/bind-address = ":1086"/g' /influxdb.conf && \ 13 | sed -i 'N;s/udp]].*enabled = false/udp]]\n enabled = true/g' /influxdb.conf 14 | 15 | 16 | FROM alpine 17 | LABEL maintainer="suconghou@gmail.com" 18 | COPY --from=build /influxdb.conf /etc/ 19 | COPY --from=build /influxd /influx /usr/local/bin/ 20 | VOLUME [ "/influxdb" ] 21 | CMD ["influxd","run","-config","/etc/influxdb.conf"] 22 | -------------------------------------------------------------------------------- /influxdb/Dockerfile-chronograf: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN wget -O- https://dl.influxdata.com/chronograf/releases/chronograf-1.8.4-static_linux_amd64.tar.gz | tar xz --strip 2 3 | 4 | FROM alpine 5 | LABEL maintainer="suconghou@gmail.com" 6 | COPY --from=build /chronoctl /usr/local/bin/ 7 | COPY --from=build /chronograf /usr/local/bin/ 8 | CMD ["chronograf"] 9 | -------------------------------------------------------------------------------- /influxdb/Dockerfile-telegraf: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN wget -O- https://dl.influxdata.com/telegraf/nightlies/telegraf-static-nightly_linux_amd64.tar.gz | tar xz --strip 1 3 | 4 | FROM alpine 5 | LABEL maintainer="suconghou@gmail.com" 6 | COPY --from=build /telegraf /usr/local/bin/ 7 | -------------------------------------------------------------------------------- /influxdb/README.MD: -------------------------------------------------------------------------------- 1 | ## influxdb 2 | 3 | influxdb,telegraf,chronograf 4 | 5 | https://portal.influxdata.com/downloads 6 | 7 | 8 | ### influxdb 9 | 10 | ``` 11 | docker network create influx 12 | ``` 13 | 14 | use 15 | ``` 16 | sed -i 's/cache-max-memory-size.*/cache-max-memory-size = 268435456/g' /influxdb.conf 17 | ``` 18 | to make it use less memory, max cache 256M 19 | 20 | if you are on a heavy load give more memory 21 | 22 | 1024M 23 | ``` 24 | sed -i 's/cache-max-memory-size.*/cache-max-memory-size = 1073741824/g' /influxdb.conf 25 | ``` 26 | 27 | 28 | ``` 29 | docker run --name influxdb -m 500m --rm -it -p 8086:8086 --net influx suconghou/influxdb 30 | ``` 31 | 32 | 33 | 34 | ``` 35 | docker run --name influxdb \ 36 | --log-opt max-size=2m \ 37 | -m 300m \ 38 | --restart always \ 39 | -d \ 40 | -p 0.0.0.0:8086:8086 \ 41 | --net influx \ 42 | suconghou/influxdb 43 | ``` 44 | 45 | 46 | 47 | ### telegraf 48 | 49 | ``` 50 | [global_tags] 51 | dc="hw" 52 | [agent] 53 | interval = "10s" 54 | round_interval = true 55 | metric_batch_size = 1000 56 | metric_buffer_limit = 10000 57 | collection_jitter = "0s" 58 | flush_interval = "10s" 59 | flush_jitter = "0s" 60 | precision = "" 61 | debug = false 62 | quiet = false 63 | logfile = "" 64 | hostname = "hw-209" 65 | omit_hostname = false 66 | [[outputs.influxdb]] 67 | urls = ["http://172.16.0.648:8086"] 68 | [[inputs.docker_log]] 69 | endpoint = "unix:///var/run/docker.sock" 70 | 71 | [[inputs.cpu]] 72 | percpu = true 73 | totalcpu = true 74 | collect_cpu_time = false 75 | report_active = false 76 | [[inputs.disk]] 77 | ignore_fs = ["tmpfs", "devtmpfs", "devfs", "overlay", "aufs", "squashfs"] 78 | [[inputs.kernel]] 79 | [[inputs.mem]] 80 | [[inputs.processes]] 81 | [[inputs.swap]] 82 | [[inputs.system]] 83 | ``` 84 | 85 | 86 | 2018-12-25T09:05:49Z I! Starting Telegraf 87 | 2018-12-25T09:05:49Z I! Loaded inputs: inputs.mem inputs.processes inputs.swap inputs.system inputs.cpu inputs.disk inputs.diskio inputs.kernel 88 | 2018-12-25T09:05:49Z I! Loaded aggregators: 89 | 2018-12-25T09:05:49Z I! Loaded processors: 90 | 2018-12-25T09:05:49Z I! Loaded outputs: influxdb 91 | 2018-12-25T09:05:49Z I! Tags enabled: host=will-image.novalocal 92 | 2018-12-25T09:05:49Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"will-image.novalocal", Flush Interval:10s 93 | 94 | 95 | ### chronograf 96 | 97 | ``` 98 | docker run --name chronograf -m 100m --rm -it -p 8888:8888 suconghou/influxdb:chronograf 99 | ``` 100 | 101 | ``` 102 | docker run --name chronograf \ 103 | -m 100m \ 104 | --restart always \ 105 | -d \ 106 | -p 127.0.0.1:8888:8888 \ 107 | --net influx \ 108 | suconghou/influxdb:chronograf 109 | ``` 110 | 111 | 112 | ## dockerfile 113 | 114 | https://github.com/suconghou/docker/tree/master/influxdb 115 | 116 | 117 | docker image https://hub.docker.com/r/suconghou/influxdb/ 118 | 119 | -------------------------------------------------------------------------------- /influxdb/make-chronograf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/influxdb:chronograf . -f Dockerfile-chronograf 3 | -------------------------------------------------------------------------------- /influxdb/make-telegraf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/influxdb:telegraf . -f Dockerfile-telegraf 3 | -------------------------------------------------------------------------------- /influxdb/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/influxdb . 3 | -------------------------------------------------------------------------------- /lighttpd/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make wget file scons python2 pcre-dev zlib-dev zlib-static bzip2-dev bzip2-static 3 | RUN LIGHTTPD_VERSION=lighttpd-1.4.55 && wget http://download.lighttpd.net/lighttpd/releases-1.4.x/${LIGHTTPD_VERSION}.tar.xz && tar xJf ${LIGHTTPD_VERSION}.tar.xz && cd ${LIGHTTPD_VERSION} && ls -lha && \ 4 | export CFLAGS=-Os && export LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic" && scons -j 4 build_static=1 build_dynamic=0 install && strip -s /usr/local/sbin/lighttpd 5 | 6 | FROM alpine 7 | LABEL maintainer="suconghou@gmail.com" 8 | COPY --from=build /usr/local/sbin/lighttpd /usr/local/sbin/lighttpd 9 | EXPOSE 80 10 | -------------------------------------------------------------------------------- /lighttpd/Dockerfile-busybox: -------------------------------------------------------------------------------- 1 | FROM suconghou/lighttpd AS build 2 | RUN /usr/local/sbin/lighttpd -V && ldd /usr/local/sbin/lighttpd 3 | 4 | FROM busybox 5 | LABEL maintainer="suconghou@gmail.com" 6 | COPY --from=build /usr/local/sbin/lighttpd /usr/local/sbin/lighttpd 7 | EXPOSE 80 8 | -------------------------------------------------------------------------------- /lighttpd/README.MD: -------------------------------------------------------------------------------- 1 | ## lighttpd 2 | 3 | lighttpd docker image 4 | 5 | http://download.lighttpd.net/lighttpd/releases-1.4.x/ 6 | 7 | lighttpd version 1.4.55 8 | 9 | 10 | ## dockerfile 11 | 12 | https://github.com/suconghou/docker/tree/master/lighttpd 13 | 14 | 15 | docker image https://hub.docker.com/r/suconghou/lighttpd/ 16 | -------------------------------------------------------------------------------- /lighttpd/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/lighttpd -t=suconghou/lighttpd:1.4.55 -t=suconghou/lighttpd:alpine . && \ 3 | docker build -t=suconghou/lighttpd:busybox . -f Dockerfile-busybox 4 | -------------------------------------------------------------------------------- /memcached/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make wget file python2 3 | RUN wget --no-check-certificate -O- https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz | tar zx && cd libevent-2.1.11-stable && ./configure && make -j2 && make install && \ 4 | MEMCACHE_VERSION=memcached-1.6.23 && wget https://www.memcached.org/files/${MEMCACHE_VERSION}.tar.gz && tar xzf ${MEMCACHE_VERSION}.tar.gz && cd ${MEMCACHE_VERSION} && ls -lha && \ 5 | CFLAGS="-O3" && ./configure --disable-docs --disable-extstore && make LDFLAGS=-static -j2 && make install && strip -s /usr/local/bin/memcached 6 | 7 | FROM alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /usr/local/bin/memcached /usr/local/bin/memcached 10 | EXPOSE 11211 11 | 12 | -------------------------------------------------------------------------------- /memcached/Dockerfile-arm32v7: -------------------------------------------------------------------------------- 1 | FROM arm32v7/alpine AS build 2 | RUN apk add --update gcc g++ make wget file python2 3 | RUN wget --no-check-certificate wget --no-check-certificate -O- https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz | tar zx && cd libevent-2.1.11-stable && ./configure && make -j2 && make install && \ 4 | MEMCACHE_VERSION=memcached-1.6.23 && wget https://www.memcached.org/files/${MEMCACHE_VERSION}.tar.gz && tar xzf ${MEMCACHE_VERSION}.tar.gz && cd ${MEMCACHE_VERSION} && ls -lha && \ 5 | CFLAGS="-O3" && ./configure --disable-docs --disable-extstore && make LDFLAGS=-static -j2 && make install && strip -s /usr/local/bin/memcached 6 | 7 | FROM arm32v7/alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /usr/local/bin/memcached /usr/local/bin/memcached 10 | EXPOSE 11211 11 | 12 | -------------------------------------------------------------------------------- /memcached/Dockerfile-arm64v8: -------------------------------------------------------------------------------- 1 | FROM arm64v8/alpine AS build 2 | RUN apk add --update gcc g++ make wget file python2 3 | RUN wget --no-check-certificate -O- https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz | tar zx && cd libevent-2.1.11-stable && ./configure && make -j2 && make install && \ 4 | MEMCACHE_VERSION=memcached-1.6.23 && wget https://www.memcached.org/files/${MEMCACHE_VERSION}.tar.gz && tar xzf ${MEMCACHE_VERSION}.tar.gz && cd ${MEMCACHE_VERSION} && ls -lha && \ 5 | CFLAGS="-O3" && ./configure --disable-docs --disable-extstore && make LDFLAGS=-static -j2 && make install && strip -s /usr/local/bin/memcached 6 | 7 | FROM arm64v8/alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /usr/local/bin/memcached /usr/local/bin/memcached 10 | EXPOSE 11211 11 | 12 | -------------------------------------------------------------------------------- /memcached/Dockerfile-busybox: -------------------------------------------------------------------------------- 1 | FROM suconghou/memcached AS build 2 | RUN /usr/local/bin/memcached -V && ldd /usr/local/bin/memcached 3 | 4 | FROM busybox 5 | LABEL maintainer="suconghou@gmail.com" 6 | COPY --from=build /usr/local/bin/memcached /usr/local/bin/memcached 7 | EXPOSE 11211 8 | 9 | -------------------------------------------------------------------------------- /memcached/README.MD: -------------------------------------------------------------------------------- 1 | ## memcached 2 | 3 | website http://www.memcached.org/ 4 | 5 | memcached all version can be found here http://www.memcached.org/files/ 6 | 7 | static build memcached 8 | 9 | memcached version v1.6.23 10 | 11 | ``` 12 | docker run --rm -it suconghou/memcached memcached -h 13 | ``` 14 | 15 | ## dockerfile 16 | 17 | https://github.com/suconghou/docker/tree/master/memcached 18 | 19 | 20 | docker image https://hub.docker.com/r/suconghou/memcached/ 21 | 22 | 23 | ## 静态编译 24 | 25 | 见 http://blog.suconghou.cn/post/memcached-usage 26 | 27 | 28 | -------------------------------------------------------------------------------- /memcached/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/memcached -t=suconghou/memcached:1.6.23 -t=suconghou/memcached:alpine . && \ 3 | docker build -t=suconghou/memcached:busybox . -f Dockerfile-busybox 4 | -------------------------------------------------------------------------------- /monit/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update wget make file gcc g++ zlib-dev zlib-static libressl-dev 3 | RUN MONIT_VERSION=monit-5.27.0 && wget --no-check-certificate https://mmonit.com/monit/dist/${MONIT_VERSION}.tar.gz && tar zxf ${MONIT_VERSION}.tar.gz && cd ${MONIT_VERSION} && ls -lha && \ 4 | export CFLAGS="-ffunction-sections -fdata-sections -Os" && \ 5 | LIBS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections -L/usr/lib/ /usr/lib/libssl.a /usr/lib/libcrypto.a" ./configure --enable-optimized --without-pam --enable-shared=no --enable-static=no --with-ssl-lib-dir=/usr/lib && \ 6 | sed -i "s{-O3{-Os{" Makefile && make -j4 && make install && strip -s /usr/local/bin/monit 7 | 8 | FROM alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /usr/local/bin/monit /usr/local/bin/monit 11 | -------------------------------------------------------------------------------- /monit/Dockerfile-slim: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update wget make file gcc g++ zlib-dev zlib-static libressl-dev 3 | RUN MONIT_VERSION=monit-5.27.0 && wget --no-check-certificate https://mmonit.com/monit/dist/${MONIT_VERSION}.tar.gz && tar zxf ${MONIT_VERSION}.tar.gz && cd ${MONIT_VERSION} && ls -lha && \ 4 | export CFLAGS="-ffunction-sections -fdata-sections -Os" && \ 5 | LIBS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" ./configure --enable-optimized --without-pam --without-ipv6 --without-ssl --without-largefiles --disable-largefile --enable-shared=no --enable-static=no && \ 6 | sed -i "s{-O3{-Os{" Makefile && make -j4 && make install && strip -s /usr/local/bin/monit 7 | 8 | FROM alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /usr/local/bin/monit /usr/local/bin/monit 11 | -------------------------------------------------------------------------------- /monit/README.MD: -------------------------------------------------------------------------------- 1 | ## monit 2 | 3 | https://mmonit.com/monit/ 4 | 5 | version 5.27.0 6 | 7 | example config file 8 | 9 | `/etc/monitrc` 10 | ``` 11 | set daemon 30 12 | set log /var/log/monit.log 13 | set httpd unixsocket /var/run/monit.sock allow user:pass 14 | 15 | check process crond with matching crond 16 | start program = "/usr/local/bin/crond" with timeout 10 seconds 17 | stop program = "/usr/local/bin/busybox killall crond" with timeout 10 seconds 18 | 19 | check process redis-server with pidfile /var/run/redis-server.pid 20 | start program = "/usr/local/bin/redis-server /etc/redis.conf" 21 | stop program = "/usr/local/bin/busybox killall redis-server" 22 | if failed port 6379 then restart 23 | 24 | ``` 25 | 26 | ### tags 27 | 28 | run `monit -V` see build config 29 | 30 | `monit:latest` 31 | 32 | ``` 33 | This is Monit version 5.27.0 34 | Built with ssl, with ipv6, with compression, without pam and with large files 35 | Copyright (C) 2001-2018 Tildeslash Ltd. All Rights Reserved. 36 | ``` 37 | 38 | 39 | `monit:slim` is the slim version without largefile and ssl support , only 770KB+ 40 | 41 | ``` 42 | This is Monit version 5.27.0 43 | Built without ssl, without ipv6, with compression, without pam and without large files 44 | Copyright (C) 2001-2018 Tildeslash Ltd. All Rights Reserved. 45 | ``` 46 | 47 | ## dockerfile 48 | 49 | https://github.com/suconghou/docker/tree/master/monit 50 | 51 | 52 | docker image https://hub.docker.com/r/suconghou/monit/ 53 | 54 | -------------------------------------------------------------------------------- /monit/make-slim.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/monit:slim . -f Dockerfile-slim 3 | -------------------------------------------------------------------------------- /monit/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/monit -t=suconghou/monit:5.27.0 . 3 | -------------------------------------------------------------------------------- /mosdns/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN wget https://github.com/IrineSistiana/mosdns/releases/download/v5.3.1/mosdns-linux-amd64.zip && \ 3 | unzip mosdns-linux-amd64.zip 4 | FROM alpine 5 | COPY --from=build /mosdns /usr/local/bin/mosdns 6 | WORKDIR /usr/local/bin/ 7 | ADD accelerated-domains.china.txt /usr/local/bin/ 8 | ADD CN-ip-cidr.txt /usr/local/bin/ 9 | ADD config.yaml /usr/local/bin/ 10 | ADD gfw.txt /usr/local/bin/ 11 | ADD hosts.txt /usr/local/bin/ 12 | ADD proxy-list.txt /usr/local/bin/ 13 | CMD [ "mosdns","start" ] -------------------------------------------------------------------------------- /mosdns/README.MD: -------------------------------------------------------------------------------- 1 | ## mosdns 2 | 3 | 4 | 5 | ``` 6 | docker run -d --name=mosdns --restart always -m 500m --log-opt max-size=10m --network host suconghou/mosdns 7 | 8 | ``` -------------------------------------------------------------------------------- /mosdns/config.yaml: -------------------------------------------------------------------------------- 1 | log: 2 | level: info 3 | production: true 4 | 5 | plugins: 6 | - tag: "direct_domain" 7 | type: domain_set 8 | args: 9 | files: 10 | - "./accelerated-domains.china.txt" 11 | 12 | - tag: "black_domain" 13 | type: domain_set 14 | args: 15 | files: 16 | - "./proxy-list.txt" 17 | - "./gfw.txt" 18 | 19 | - tag: "direct_ip" 20 | type: ip_set 21 | args: 22 | files: 23 | - "./CN-ip-cidr.txt" 24 | 25 | - tag: "hosts" 26 | type: hosts 27 | args: 28 | files: 29 | - "./hosts.txt" 30 | 31 | - tag: "cache" 32 | type: cache 33 | args: 34 | size: 65536 35 | lazy_cache_ttl: 86400 36 | 37 | - tag: "remote_forward" 38 | type: forward 39 | args: 40 | concurrent: 2 41 | upstreams: 42 | - addr: "https://223.6.6.6/dns-query" 43 | idle_timeout: 86400 44 | - addr: "https://doh.360.cn/dns-query" 45 | idle_timeout: 86400 46 | 47 | - tag: "local_forward" 48 | type: forward 49 | args: 50 | concurrent: 2 51 | upstreams: 52 | - addr: "https://223.5.5.5/dns-query" 53 | idle_timeout: 86400 54 | - addr: "https://dns.pub/dns-query" 55 | idle_timeout: 86400 56 | 57 | - tag: "ttl_sequence" 58 | type: sequence 59 | args: 60 | - exec: ttl 600-3600 61 | - exec: accept 62 | 63 | - tag: "local_sequence" 64 | type: sequence 65 | args: 66 | - exec: query_summary local_forward 67 | - exec: $local_forward 68 | - exec: goto ttl_sequence 69 | 70 | - tag: "remote_sequence" 71 | type: sequence 72 | args: 73 | - exec: query_summary remote_forward 74 | - exec: $remote_forward 75 | - matches: "resp_ip $direct_ip" 76 | exec: goto local_sequence 77 | - exec: goto ttl_sequence 78 | 79 | - tag: "hijack" 80 | type: sequence 81 | args: 82 | - exec: black_hole 192.168.0.3 83 | - exec: return 84 | 85 | 86 | - tag: "final" 87 | type: fallback 88 | args: 89 | primary: remote_sequence 90 | secondary: local_sequence 91 | threshold: 500 92 | always_standby: true 93 | 94 | - tag: "main_sequence" 95 | type: sequence 96 | args: 97 | - exec: prefer_ipv4 98 | - exec: $hosts 99 | - exec: $cache 100 | - matches: has_resp 101 | exec: accept 102 | - matches: "qname $direct_domain" 103 | exec: goto local_sequence 104 | - matches: "qname $black_domain" 105 | exec: goto hijack 106 | - exec: $final 107 | 108 | 109 | - tag: udp_server 110 | type: udp_server 111 | args: 112 | entry: main_sequence 113 | listen: :53 -------------------------------------------------------------------------------- /mosdns/hosts.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suconghou/docker/82944e74b8625e062d3daf09d61c1b069375cb6f/mosdns/hosts.txt -------------------------------------------------------------------------------- /mosquitto/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make openssl-dev openssl-libs-static 3 | RUN wget -O- https://github.com/eclipse/mosquitto/archive/v.1.6.8.tar.gz | tar xz && \ 4 | cd mosquitto-* && \ 5 | make binary -j2 WITH_DOCS=no WITH_BUNDLED_DEPS=no && (make install || true) && \ 6 | strip -s /usr/local/bin/* && strip -s /usr/local/sbin/* 7 | 8 | FROM alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | RUN adduser -HDG nobody -h / -s /sbin/nologin -g mosquitto mosquitto 11 | COPY --from=build /usr/local/sbin/mosquitto /usr/local/sbin/ 12 | COPY --from=build /usr/local/bin/mosquitto* /usr/local/bin/ 13 | COPY --from=build /usr/local/lib/libmosquitto.so.1 /usr/local/lib/libmosquitto.so.1 14 | CMD [ "mosquitto" ] -------------------------------------------------------------------------------- /mosquitto/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/mosquitto . 3 | 4 | -------------------------------------------------------------------------------- /nghttpx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update xz wget make file curl gcc g++ libev-dev zlib-dev zlib-static openssl-dev openssl-libs-static c-ares-dev 3 | RUN curl -sSL https://github.com/nghttp2/nghttp2/releases/download/v1.38.0/nghttp2-1.38.0.tar.xz | tar xJ --strip 1 && ls -lha 4 | RUN CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" ./configure --disable-python-bindings --disable-examples --disable-shared && \ 5 | make LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" && make install && strip -s /usr/local/bin/nghttpx 6 | 7 | FROM alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /usr/local/bin/nghttpx /usr/local/bin/nghttpx 10 | -------------------------------------------------------------------------------- /nghttpx/README.MD: -------------------------------------------------------------------------------- 1 | ## nghttpx 2 | 3 | https://github.com/nghttp2/nghttp2 4 | 5 | 6 | 7 | 8 | 默认配置文件位置`/etc/nghttpx/nghttpx.conf` 9 | 10 | 示例配置 11 | ``` 12 | frontend=0.0.0.0,80;tls 13 | backend=127.0.0.1,3128;no-tls 14 | private-key-file=xx.key 15 | certificate-file=xx.crt 16 | http2-proxy=yes 17 | 18 | workers=1 19 | # 关闭客户端 TLS 认证 20 | verify-client=no 21 | # 不添加 X-Forwarded-For 头 22 | add-x-forwarded-for=no 23 | # 不添加 Via 头 24 | no-via=yes 25 | # 不查询 OCSP 服务器 26 | no-ocsp=yes 27 | # 只使用 TLS 1.2 28 | tls-min-proto-version=TLSv1.2 29 | tls-max-proto-version=TLSv1.2 30 | # 只使用 ECDHE 交换(目前性能安全比最优)和 AES 加密,指定 128 位是因为它已经足够安全但性能比 256 位稍优一些 31 | ciphers=ECDHE+AES128 32 | ``` 33 | 34 | 35 | 使用 `nghttpx -b 127.0.0.1,8123` 启动 36 | 37 | ## Dockerfile 38 | 39 | https://github.com/suconghou/docker/tree/master/nghttpx 40 | 41 | Docker image https://hub.docker.com/r/suconghou/nghttpx/ 42 | 43 | -------------------------------------------------------------------------------- /nghttpx/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/nghttpx -t=suconghou/nghttpx:1.38.0 . 3 | -------------------------------------------------------------------------------- /nginx-google/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | *.MD 3 | -------------------------------------------------------------------------------- /nginx-google/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make wget git file openssl-dev openssl-libs-static pcre-dev zlib-dev zlib-static 3 | RUN git clone https://github.com/cuber/ngx_http_google_filter_module 4 | RUN git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module 5 | RUN NGINX_VERSION=nginx-1.25.3 && wget http://nginx.org/download/${NGINX_VERSION}.tar.gz && tar zxf ${NGINX_VERSION}.tar.gz && cd ${NGINX_VERSION} && ls -lha && \ 6 | ./configure --with-http_v2_module --with-http_ssl_module --with-stream --with-stream_ssl_preread_module --sbin-path=/usr/local/sbin/nginx --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock \ 7 | --without-select_module \ 8 | --without-poll_module \ 9 | --without-http_access_module \ 10 | --without-http_auth_basic_module \ 11 | --without-http_autoindex_module \ 12 | --without-http_browser_module \ 13 | --without-http_charset_module \ 14 | --without-http_empty_gif_module \ 15 | --without-http_fastcgi_module \ 16 | --without-http_geo_module \ 17 | --without-http_map_module \ 18 | --without-http_memcached_module \ 19 | --without-http_referer_module \ 20 | --without-http_scgi_module \ 21 | --without-http_split_clients_module \ 22 | --without-http_ssi_module \ 23 | --without-http_limit_req_module \ 24 | --without-http_upstream_ip_hash_module \ 25 | --without-http_upstream_keepalive_module \ 26 | --without-http_upstream_least_conn_module \ 27 | --without-http_userid_module \ 28 | --without-http_uwsgi_module \ 29 | --without-mail_imap_module \ 30 | --without-mail_pop3_module \ 31 | --without-mail_smtp_module \ 32 | --add-module=/ngx_http_google_filter_module \ 33 | --add-module=/ngx_http_substitutions_filter_module \ 34 | && \ 35 | sed -i "s/-lpcre -lssl -lcrypto -lz/-static -lpcre -lssl -lcrypto -lz/g" objs/Makefile && make -j2 CFLAGS=-Os LDFLAGS=-static && make install && \ 36 | strip -s /usr/local/sbin/nginx && rm -rf /etc/nginx/*.default 37 | 38 | FROM alpine 39 | LABEL maintainer="suconghou@gmail.com" 40 | COPY --from=build /usr/local/sbin/nginx /usr/local/sbin/nginx 41 | COPY --from=build /etc/nginx /etc/nginx 42 | COPY --from=build /var/log/nginx /var/log/nginx 43 | RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log 44 | WORKDIR /etc/nginx 45 | EXPOSE 80 443 46 | -------------------------------------------------------------------------------- /nginx-google/README.MD: -------------------------------------------------------------------------------- 1 | ## nginx-google 2 | 3 | **a very tiny nginx container with google proxy** 4 | 5 | It is very small only 7.79MB with google proxy 6 | 7 | its nginx version is 1.13.3 8 | 9 | ## Usage 10 | 11 | ``` 12 | docker run -d --name nginx -p 6060:80 --restart always -m 20m --log-opt max-size=2m suconghou/nginx-google nginx -g 'daemon off;' 13 | ``` 14 | or 15 | ``` 16 | docker run -d --name nginx -p 6060:80 --restart always -m 20m --log-opt max-size=2m suconghou/nginx-google /bin/sh -c "nginx ;while true ; do sleep 60 ;done " 17 | ``` 18 | or 19 | ``` 20 | docker run -it --name nginx -p 6060:80 --restart always -m 20m --log-opt max-size=2m suconghou/nginx-google sh 21 | ``` 22 | and then just start nginx in the shell and CTRL+P+Q to leave the container. 23 | 24 | You can also use your nginx to proxy the port 6060 25 | ``` 26 | server{ 27 | listen 80; 28 | server_name example.com; 29 | gzip on; 30 | gzip_proxied any; 31 | gzip_min_length 1024; 32 | gzip_comp_level 3; 33 | gzip_types text/plain text/javascript text/css text/json application/javascript application/json image/jpeg image/gif image/png; 34 | location / { 35 | proxy_pass http://127.0.0.1:6060; 36 | proxy_set_header Host $host; 37 | proxy_set_header X-Forwarded-Ssl off; 38 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 39 | proxy_set_header X-Forwarded-Port 80; 40 | } 41 | } 42 | 43 | ``` 44 | use `--log-opt` to limit log file size 45 | 46 | use`-m` to limit memory usage 47 | 48 | use`--restart` to set docker container restart once process exit 49 | 50 | ## Dockerfile 51 | 52 | https://github.com/suconghou/docker/tree/master/nginx-google 53 | 54 | Docker image https://hub.docker.com/r/suconghou/nginx-google/ 55 | 56 | `http_rewrite_module` 57 | `http_proxy_module` 58 | 59 | 也可静态编译,同nginx的编译 60 | 61 | -------------------------------------------------------------------------------- /nginx-google/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/nginx-google . 3 | 4 | -------------------------------------------------------------------------------- /nginx-google/nginx.conf: -------------------------------------------------------------------------------- 1 | user nobody; 2 | worker_processes 1; 3 | daemon off; 4 | events { 5 | worker_connections 1024; 6 | } 7 | http { 8 | include mime.types; 9 | default_type application/octet-stream; 10 | sendfile on; 11 | tcp_nopush on; 12 | tcp_nodelay on; 13 | server_tokens off; 14 | keepalive_timeout 65; 15 | server { 16 | listen 80 reuseport fastopen=3; 17 | server_name 0.0.0.0; 18 | expires 30d; 19 | resolver 8.8.8.8 8.8.4.4 valid=3600s; 20 | resolver_timeout 5s; 21 | gzip on; 22 | gzip_min_length 1024; 23 | gzip_proxied any; 24 | gzip_comp_level 3; 25 | gzip_types text/plain text/javascript text/css text/json application/xml application/javascript application/json image/jpeg image/gif image/png image/bmp font/ttf font/otf image/svg+xml; 26 | proxy_hide_header Set-Cookie; 27 | proxy_hide_header Alt-Svc; 28 | proxy_hide_header Alternate-Protocol; 29 | location / { 30 | google on; 31 | google_scholar on; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk --update add gcc g++ make wget file openssl-dev openssl-libs-static pcre-dev zlib-dev zlib-static linux-headers 3 | RUN NGINX_VERSION=nginx-1.25.3 && wget http://nginx.org/download/${NGINX_VERSION}.tar.gz && tar zxf ${NGINX_VERSION}.tar.gz && cd ${NGINX_VERSION} && \ 4 | ./configure --with-pcre --with-pcre-jit --with-http_v2_module --with-http_ssl_module --with-file-aio --sbin-path=/usr/local/sbin/nginx --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock && \ 5 | sed -i "s/-lpcre -lssl -lcrypto -lz/-static -lpcre -lssl -lcrypto -lz/g" objs/Makefile && make -j2 CFLAGS=-O3 LDFLAGS=-static && make install && \ 6 | strip -s /usr/local/sbin/nginx && rm -rf /etc/nginx/*.default 7 | 8 | FROM alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /usr/local/sbin/nginx /usr/local/sbin/nginx 11 | COPY --from=build /etc/nginx /etc/nginx 12 | COPY --from=build /var/log/nginx /var/log/nginx 13 | RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log 14 | WORKDIR /etc/nginx 15 | EXPOSE 80 443 16 | -------------------------------------------------------------------------------- /nginx/Dockerfile-arm32v7: -------------------------------------------------------------------------------- 1 | FROM arm32v7/alpine AS build 2 | RUN apk add --update gcc g++ make wget file openssl-dev openssl-libs-static pcre-dev zlib-dev zlib-static linux-headers 3 | RUN NGINX_VERSION=nginx-1.25.3 && wget http://nginx.org/download/${NGINX_VERSION}.tar.gz && tar zxf ${NGINX_VERSION}.tar.gz && cd ${NGINX_VERSION} && \ 4 | ./configure --with-pcre --with-pcre-jit --with-http_v2_module --with-http_ssl_module --with-http_slice_module --with-stream --with-stream_ssl_preread_module --with-file-aio --sbin-path=/usr/local/sbin/nginx --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock && \ 5 | sed -i "s/-lpcre -lssl -lcrypto -lz/-static -lpcre -lssl -lcrypto -lz/g" objs/Makefile && make -j2 CFLAGS=-O3 LDFLAGS=-static && make install && \ 6 | strip -s /usr/local/sbin/nginx && rm -rf /etc/nginx/*.default 7 | 8 | FROM arm32v7/alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /usr/local/sbin/nginx /usr/local/sbin/nginx 11 | COPY --from=build /etc/nginx /etc/nginx 12 | COPY --from=build /var/log/nginx /var/log/nginx 13 | RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log 14 | WORKDIR /etc/nginx 15 | EXPOSE 80 443 16 | -------------------------------------------------------------------------------- /nginx/Dockerfile-arm64v8: -------------------------------------------------------------------------------- 1 | FROM arm64v8/alpine AS build 2 | RUN apk add --update gcc g++ make wget file openssl-dev openssl-libs-static pcre-dev zlib-dev zlib-static linux-headers 3 | RUN NGINX_VERSION=nginx-1.25.3 && wget http://nginx.org/download/${NGINX_VERSION}.tar.gz && tar zxf ${NGINX_VERSION}.tar.gz && cd ${NGINX_VERSION} && \ 4 | ./configure --with-pcre --with-pcre-jit --with-http_v2_module --with-http_ssl_module --with-http_slice_module --with-stream --with-stream_ssl_preread_module --with-file-aio --sbin-path=/usr/local/sbin/nginx --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock && \ 5 | sed -i "s/-lpcre -lssl -lcrypto -lz/-static -lpcre -lssl -lcrypto -lz/g" objs/Makefile && make -j2 CFLAGS=-O3 LDFLAGS=-static && make install && \ 6 | strip -s /usr/local/sbin/nginx && rm -rf /etc/nginx/*.default 7 | 8 | FROM arm64v8/alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /usr/local/sbin/nginx /usr/local/sbin/nginx 11 | COPY --from=build /etc/nginx /etc/nginx 12 | COPY --from=build /var/log/nginx /var/log/nginx 13 | RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log 14 | WORKDIR /etc/nginx 15 | EXPOSE 80 443 16 | -------------------------------------------------------------------------------- /nginx/Dockerfile-busybox: -------------------------------------------------------------------------------- 1 | FROM suconghou/nginx AS build 2 | 3 | FROM busybox 4 | LABEL maintainer="suconghou@gmail.com" 5 | COPY --from=build /usr/local/sbin/nginx /usr/local/sbin/nginx 6 | COPY --from=build /etc/nginx /etc/nginx 7 | COPY --from=build /var/log/nginx /var/log/nginx 8 | COPY --from=build /var/run /var/run 9 | RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log 10 | WORKDIR /etc/nginx 11 | EXPOSE 80 443 12 | -------------------------------------------------------------------------------- /nginx/Dockerfile-debug: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make wget file openssl-dev openssl-libs-static pcre-dev zlib-dev zlib-static linux-headers 3 | RUN NGINX_VERSION=nginx-1.25.3 && wget http://nginx.org/download/${NGINX_VERSION}.tar.gz && tar zxf ${NGINX_VERSION}.tar.gz && cd ${NGINX_VERSION} && \ 4 | ./configure --with-pcre --with-pcre-jit --with-http_v2_module --with-http_ssl_module --with-http_slice_module --with-stream --with-stream_ssl_preread_module --with-file-aio --with-debug --sbin-path=/usr/local/sbin/nginx --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock && \ 5 | sed -i "s/-lpcre -lssl -lcrypto -lz/-static -lpcre -lssl -lcrypto -lz/g" objs/Makefile && make -j2 CFLAGS=-Os LDFLAGS=-static && make install && \ 6 | strip -s /usr/local/sbin/nginx && rm -rf /etc/nginx/*.default 7 | 8 | FROM alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /usr/local/sbin/nginx /usr/local/sbin/nginx 11 | COPY --from=build /etc/nginx /etc/nginx 12 | COPY --from=build /var/log/nginx /var/log/nginx 13 | RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log 14 | WORKDIR /etc/nginx 15 | EXPOSE 80 443 16 | -------------------------------------------------------------------------------- /nginx/Dockerfile-flv: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make wget file openssl-dev openssl-libs-static pcre-dev zlib-dev zlib-static linux-headers 4 | RUN NGINX_VERSION=nginx-1.25.3 && wget http://nginx.org/download/${NGINX_VERSION}.tar.gz && tar zxf ${NGINX_VERSION}.tar.gz && cd ${NGINX_VERSION} && \ 5 | wget -O- https://github.com/winshining/nginx-http-flv-module/archive/v1.2.11.tar.gz | tar xz && \ 6 | wget -O- https://github.com/kaltura/nginx-vod-module/archive/1.32.tar.gz | tar xz && \ 7 | ./configure --with-pcre --with-pcre-jit --with-http_v2_module --with-http_ssl_module --with-http_slice_module --with-stream --with-stream_ssl_preread_module --with-file-aio --with-http_flv_module --with-http_mp4_module --add-module=nginx-http-flv-module-1.2.11 --add-module=nginx-vod-module-1.32 --sbin-path=/usr/local/sbin/nginx --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock && \ 8 | sed -i "s/-lpcre -lssl -lcrypto -lz/-static -lpcre -lssl -lcrypto -lz/g" objs/Makefile && make -j2 CFLAGS=-O3 LDFLAGS=-static && make install && \ 9 | strip -s /usr/local/sbin/nginx && rm -rf /etc/nginx/*.default 10 | 11 | FROM alpine 12 | LABEL maintainer="suconghou@gmail.com" 13 | COPY --from=build /usr/local/sbin/nginx /usr/local/sbin/nginx 14 | COPY --from=build /etc/nginx /etc/nginx 15 | COPY --from=build /var/log/nginx /var/log/nginx 16 | RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log 17 | WORKDIR /etc/nginx 18 | EXPOSE 80 443 19 | -------------------------------------------------------------------------------- /nginx/Dockerfile-http3: -------------------------------------------------------------------------------- 1 | FROM alpine:edge AS build 2 | RUN apk --update add gcc g++ make cmake wget file git cargo rust patch pcre-dev zlib-dev zlib-static linux-headers 3 | RUN NGINX_VERSION=nginx-1.25.3 && wget http://nginx.org/download/${NGINX_VERSION}.tar.gz && tar zxf ${NGINX_VERSION}.tar.gz && cd ${NGINX_VERSION} && \ 4 | git clone --depth=1 --recursive --shallow-submodules https://github.com/google/ngx_brotli && \ 5 | git clone --depth=1 --recursive --shallow-submodules https://github.com/openresty/headers-more-nginx-module && \ 6 | NJS_TAG=0.8.5 && git clone --branch $NJS_TAG --depth=1 --recursive --shallow-submodules https://github.com/nginx/njs && \ 7 | QUICHE_CHECKOUT=83d9168ab6f76302ae846cb068cc8991f2b06479 && \ 8 | git clone --recursive https://github.com/cloudflare/quiche && cd quiche && git checkout --recurse-submodules $QUICHE_CHECKOUT && cd .. && \ 9 | wget -O nginx_with_quic.patch https://raw.githubusercontent.com/kn007/patch/1062e64ead7e1b21a52392cdd02d1d5bc631d231/nginx_with_quic.patch && \ 10 | wget -O Enable_BoringSSL_OCSP.patch https://raw.githubusercontent.com/kn007/patch/cd03b77647c9bf7179acac0125151a0fbb4ac7c8/Enable_BoringSSL_OCSP.patch && \ 11 | patch -p01 < nginx_with_quic.patch && \ 12 | patch -p01 < Enable_BoringSSL_OCSP.patch && \ 13 | mkdir -p /root/.cargo && \ 14 | echo $'[net]\ngit-fetch-with-cli = true' > /root/.cargo/config.toml && \ 15 | ./configure --with-pcre --with-pcre-jit \ 16 | --with-http_v2_module --with-http_v2_hpack_enc --with-http_v3_module \ 17 | --with-http_ssl_module --with-http_slice_module \ 18 | --with-http_flv_module --with-http_mp4_module \ 19 | --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module \ 20 | --with-file-aio --with-openssl=quiche/quiche/deps/boringssl \ 21 | --with-quiche=quiche \ 22 | --add-module=ngx_brotli \ 23 | --add-module=headers-more-nginx-module \ 24 | --add-module=njs/nginx \ 25 | --sbin-path=/usr/local/sbin/nginx \ 26 | --prefix=/etc/nginx \ 27 | --conf-path=/etc/nginx/nginx.conf \ 28 | --http-log-path=/var/log/nginx/access.log \ 29 | --error-log-path=/var/log/nginx/error.log \ 30 | --pid-path=/var/run/nginx.pid \ 31 | --lock-path=/var/run/nginx.lock && \ 32 | sed -i "s/-lpcre quiche\/quiche\/deps\/boringssl\/.openssl\/lib\/libssl.a quiche\/quiche\/deps\/boringssl\/.openssl\/lib\/libcrypto.a quiche\/target\/release\/libquiche.a -lm -lz/-static -lpcre quiche\/quiche\/deps\/boringssl\/.openssl\/lib\/libssl.a quiche\/quiche\/deps\/boringssl\/.openssl\/lib\/libcrypto.a quiche\/target\/release\/libquiche.a -lm -lz/g" objs/Makefile && \ 33 | make -j2 CFLAGS=-O3 LDFLAGS=-static && make install && \ 34 | strip -s /usr/local/sbin/nginx && rm -rf /etc/nginx/*.default 35 | 36 | FROM alpine 37 | LABEL maintainer="suconghou@gmail.com" 38 | COPY --from=build /usr/local/sbin/nginx /usr/local/sbin/nginx 39 | COPY --from=build /etc/nginx /etc/nginx 40 | COPY --from=build /var/log/nginx /var/log/nginx 41 | RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log 42 | WORKDIR /etc/nginx 43 | EXPOSE 80 443 44 | -------------------------------------------------------------------------------- /nginx/Dockerfile-rtmp: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk --update add gcc g++ make wget file openssl-dev openssl-libs-static pcre-dev zlib-dev zlib-static linux-headers 4 | RUN NGINX_VERSION=nginx-1.25.3 && wget http://nginx.org/download/${NGINX_VERSION}.tar.gz && tar zxf ${NGINX_VERSION}.tar.gz && cd ${NGINX_VERSION} && \ 5 | wget -O- https://github.com/arut/nginx-rtmp-module/archive/refs/tags/v1.2.2.tar.gz | tar xz && \ 6 | ./configure --with-pcre --with-pcre-jit --with-http_v2_module --with-http_ssl_module --with-file-aio --add-module=nginx-rtmp-module-1.2.2 --with-debug --sbin-path=/usr/local/sbin/nginx --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock && \ 7 | sed -i "s/-lpcre -lssl -lcrypto -lz/-static -lpcre -lssl -lcrypto -lz/g" objs/Makefile && make -j2 CFLAGS=-O3 LDFLAGS=-static && make install && \ 8 | strip -s /usr/local/sbin/nginx && rm -rf /etc/nginx/*.default 9 | 10 | FROM alpine 11 | LABEL maintainer="suconghou@gmail.com" 12 | COPY --from=build /usr/local/sbin/nginx /usr/local/sbin/nginx 13 | COPY --from=build /etc/nginx /etc/nginx 14 | COPY --from=build /var/log/nginx /var/log/nginx 15 | RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log 16 | WORKDIR /etc/nginx 17 | EXPOSE 80 443 18 | -------------------------------------------------------------------------------- /nginx/Dockerfile-stream: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make wget file openssl-dev openssl-libs-static pcre-dev zlib-dev zlib-static linux-headers 4 | RUN NGINX_VERSION=nginx-1.25.3 && wget http://nginx.org/download/${NGINX_VERSION}.tar.gz && tar zxf ${NGINX_VERSION}.tar.gz && cd ${NGINX_VERSION} && \ 5 | ./configure --with-pcre --with-pcre-jit --with-http_v2_module --with-http_ssl_module --with-http_slice_module --with-stream --with-stream_ssl_preread_module --with-file-aio --sbin-path=/usr/local/sbin/nginx --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock && \ 6 | sed -i "s/-lpcre -lssl -lcrypto -lz/-static -lpcre -lssl -lcrypto -lz/g" objs/Makefile && make -j2 CFLAGS=-O3 LDFLAGS=-static && make install && \ 7 | strip -s /usr/local/sbin/nginx && rm -rf /etc/nginx/*.default 8 | 9 | FROM alpine 10 | LABEL maintainer="suconghou@gmail.com" 11 | COPY --from=build /usr/local/sbin/nginx /usr/local/sbin/nginx 12 | COPY --from=build /etc/nginx /etc/nginx 13 | COPY --from=build /var/log/nginx /var/log/nginx 14 | RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log 15 | WORKDIR /etc/nginx 16 | EXPOSE 80 443 17 | -------------------------------------------------------------------------------- /nginx/Dockerfile-tengine: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make wget file openssl-dev openssl-libs-static pcre-dev zlib-dev zlib-static linux-headers 3 | RUN TENGINE_VERSION=tengine-2.3.3 && wget http://tengine.taobao.org/download/${TENGINE_VERSION}.tar.gz && tar zxf ${TENGINE_VERSION}.tar.gz && cd ${TENGINE_VERSION} && \ 4 | ./configure --with-pcre --with-pcre-jit --with-http_v2_module --with-http_ssl_module --with-http_slice_module --with-stream --with-stream_ssl_preread_module --with-file-aio --with-stream_ssl_module --with-stream_sni --add-module=./modules/ngx_http_proxy_connect_module --add-module=./modules/ngx_http_concat_module --sbin-path=/usr/local/sbin/nginx --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock && \ 5 | sed -i "s/-lpcre -lssl -lcrypto -lz/-static -lpcre -lssl -lcrypto -lz/g" objs/Makefile && make -j2 CFLAGS=-O3 LDFLAGS=-static && make install && \ 6 | strip -s /usr/local/sbin/nginx && rm -rf /etc/nginx/*.default 7 | 8 | FROM alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /usr/local/sbin/nginx /usr/local/sbin/nginx 11 | COPY --from=build /etc/nginx /etc/nginx 12 | COPY --from=build /var/log/nginx /var/log/nginx 13 | RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log 14 | WORKDIR /etc/nginx 15 | EXPOSE 80 443 16 | -------------------------------------------------------------------------------- /nginx/README.MD: -------------------------------------------------------------------------------- 1 | ## nginx 2 | 3 | static build nginx 4 | 5 | nginx version 1.25.3 6 | 7 | ## Usage 8 | 9 | ``` 10 | FROM suconghou/nginx 11 | ADD . . 12 | RUN cp nginx.conf /etc/nginx/nginx.conf 13 | EXPOSE 80 443 14 | CMD ["nginx", "-g", "daemon off;"] 15 | ``` 16 | 17 | 18 | ## Dockerfile 19 | 20 | https://github.com/suconghou/docker/tree/master/nginx 21 | 22 | Docker image https://hub.docker.com/r/suconghou/nginx/ 23 | 24 | static build 25 | 26 | 在运行 `make`之前 27 | 28 | 修改`objs/Makefile`文件, 搜索`link`关键字, 在 link `objs/nginx` 的时候补充上 `-static`参数静态编译 29 | ``` 30 | objs/ngx_modules.o -static \ 31 | ``` 32 | 33 | 34 | for nginx:busybox can be run use `nginx -g "user root root;"` 35 | 36 | 因为 busybox 里面没有`nobody`组,执行`addgroup nobody`添加组后也可以直接运行。 37 | 38 | ## http3 39 | 40 | 参考 41 | 42 | https://github.com/patrikjuvonen/docker-nginx-http3 43 | 44 | 去除部分扩展 45 | 改为静态编译 46 | 47 | -------------------------------------------------------------------------------- /nginx/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/nginx -t=suconghou/nginx:1.25.3 -t=suconghou/nginx:alpine . && \ 3 | docker build -t=suconghou/nginx:busybox . -f Dockerfile-busybox 4 | 5 | -------------------------------------------------------------------------------- /nginx/makedebug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/nginx:debug . -f Dockerfile-debug 3 | 4 | -------------------------------------------------------------------------------- /nginx/makestream.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/nginx:stream . -f Dockerfile-stream 3 | 4 | -------------------------------------------------------------------------------- /nginx/maketengine.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/nginx:tengine . -f Dockerfile-tengine 3 | 4 | -------------------------------------------------------------------------------- /node/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update libstdc++ binutils-gold curl g++ gcc gnupg libgcc linux-headers make python3 4 | RUN NODE_VERSION=22.15.0 && curl -sSL https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.xz | tar xJ 5 | RUN cd node-v*.*.* && CFLAGS="-O3 -ffunction-sections -fdata-sections" LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" ./configure && make -j$(nproc) CFLAGS="-O3 -ffunction-sections -fdata-sections" LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" && \ 6 | cd out/Release && strip -s node openssl-cli && mv node openssl-cli / 7 | 8 | FROM alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /node /usr/local/bin/node 11 | COPY --from=build /openssl-cli /usr/local/bin/openssl-cli 12 | 13 | 14 | -------------------------------------------------------------------------------- /node/Dockerfile-arm32v7: -------------------------------------------------------------------------------- 1 | FROM arm32v7/alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update libstdc++ binutils-gold curl g++ gcc gnupg libgcc linux-headers make python3 4 | RUN NODE_VERSION=22.15.0 && curl -sSL https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.xz | tar xJ 5 | RUN cd node-v*.*.* && CFLAGS="-O3 -ffunction-sections -fdata-sections" LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" ./configure && make -j2 CFLAGS="-O3 -ffunction-sections -fdata-sections" LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" && \ 6 | cd out/Release && strip -s node openssl-cli && mv node openssl-cli / 7 | 8 | FROM arm32v7/alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /node /usr/local/bin/node 11 | COPY --from=build /openssl-cli /usr/local/bin/openssl-cli 12 | 13 | 14 | -------------------------------------------------------------------------------- /node/Dockerfile-arm64v8: -------------------------------------------------------------------------------- 1 | FROM arm64v8/alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update libstdc++ binutils-gold curl g++ gcc gnupg libgcc linux-headers make python3 4 | RUN NODE_VERSION=22.15.0 && curl -sSL https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.xz | tar xJ 5 | RUN cd node-v*.*.* && CFLAGS="-O3 -ffunction-sections -fdata-sections" LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" ./configure && make CFLAGS="-O3 -ffunction-sections -fdata-sections" LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" && \ 6 | cd out/Release && strip -s node openssl-cli && mv node openssl-cli / 7 | 8 | FROM arm64v8/alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /node /usr/local/bin/node 11 | COPY --from=build /openssl-cli /usr/local/bin/openssl-cli 12 | 13 | 14 | -------------------------------------------------------------------------------- /node/Dockerfile-pnpm: -------------------------------------------------------------------------------- 1 | FROM suconghou/node:yarn 2 | RUN yarn global add pnpm \ 3 | && echo 'registry=https://registry.npmmirror.com' > .npmrc \ 4 | && pnpm config list && pnpm -v 5 | -------------------------------------------------------------------------------- /node/Dockerfile-yarn: -------------------------------------------------------------------------------- 1 | FROM suconghou/node 2 | LABEL maintainer="suconghou@gmail.com" 3 | RUN YARN_VERSION=1.22.22 && mkdir -p /opt/yarn/ \ 4 | && wget -O- --no-check-certificate https://mirrors.huaweicloud.com/yarn/v$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz | tar xz --strip 1 -C /opt/yarn \ 5 | && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ 6 | && ln -s /opt/yarn/bin/yarnpkg /usr/local/bin/yarnpkg && yarn config set registry https://registry.npmmirror.com 7 | -------------------------------------------------------------------------------- /node/README.MD: -------------------------------------------------------------------------------- 1 | ## nodejs 2 | 3 | 静态编译 node 4 | 5 | 参考 https://github.com/nodejs/docker-node/blob/master/10/alpine/Dockerfile 6 | 7 | 单核编译可能需要2个小时,请谨慎处理. 8 | 9 | 可以使用下面的命令限制编译时最多使用50%的CPU 10 | ``` 11 | docker build -t=suconghou/node -t=suconghou/node:22.15.0 --cpu-period=100000 --cpu-quota=50000 . 12 | ``` 13 | 14 | alpine源里的nodejs可由`apk search nodejs`查看 15 | 16 | ## MongoDb 17 | 18 | 19 | `apk search mongodb` 20 | 21 | `apk add mongodb` 22 | 23 | `mongo --version` 24 | 25 | `mongod --version` 26 | 27 | `mongos --version` 28 | 29 | `mongoperf -h` 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /node/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/node -t=suconghou/node:22.15.0 . 3 | 4 | -------------------------------------------------------------------------------- /node/makeyarn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/node:yarn . -f Dockerfile-yarn 3 | 4 | -------------------------------------------------------------------------------- /nuster/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make curl linux-headers pcre-dev zlib-dev zlib-static openssl-dev openssl-libs-static 3 | RUN NUSTER_VERION=5.3.0.23 && curl -sSL https://github.com/jiangwenyuan/nuster/releases/download/v${NUSTER_VERION}/nuster-${NUSTER_VERION}.tar.gz | tar xz --strip 1 && ls -lha && \ 4 | make TARGET=linux-glibc ARCH=X86_64 USE_OPENSSL=1 USE_STATIC_PCRE=1 USE_PCRE_JIT=1 USE_ZLIB=1 LDFLAGS="-s -static" ADDLIB="/usr/lib/libc.a -lz" CFLAGS="-O3" -j2 && make install && strip -s /usr/local/sbin/haproxy 5 | 6 | FROM alpine 7 | LABEL maintainer="suconghou@gmail.com" 8 | COPY --from=build /usr/local/sbin/haproxy /usr/local/sbin/haproxy 9 | -------------------------------------------------------------------------------- /nuster/README.MD: -------------------------------------------------------------------------------- 1 | ## nuster 2 | 3 | https://github.com/jiangwenyuan/nuster 4 | 5 | nuster docker image 6 | 7 | static build nuster 8 | 9 | nuster version 5.3.0.23 10 | 11 | 12 | ## Dockerfile 13 | 14 | https://github.com/suconghou/docker/tree/master/nuster 15 | 16 | docker image https://hub.docker.com/r/suconghou/nuster/ 17 | 18 | static build 19 | 20 | -------------------------------------------------------------------------------- /nuster/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/nuster -t=suconghou/nuster:5.3.0.23 . 3 | -------------------------------------------------------------------------------- /openresty/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make wget perl pcre-dev openssl-dev openssl-libs-static zlib-dev zlib-static 4 | RUN OPENRESTY_VERSION=openresty-1.27.1.2 && wget https://openresty.org/download/${OPENRESTY_VERSION}.tar.gz && tar xzf ${OPENRESTY_VERSION}.tar.gz 5 | RUN cd openresty-* && \ 6 | rm -f /usr/lib/libcrypto.so* /usr/lib/libssl.so* /usr/lib/libpcre.so* && \ 7 | ./configure --with-luajit-ldflags="-static" --with-pcre --with-pcre-jit --with-http_v2_module --with-http_slice_module --with-http_stub_status_module --with-http_sub_module --with-http_addition_module --with-http_realip_module -j4 && \ 8 | make -j8 && make install 9 | # RUN strip -s /usr/local/openresty/nginx/sbin/nginx /usr/lib/libgcc_s.so.1 /usr/local/openresty/luajit/lib/libluajit-5.1.so.2.1.0 && \ 10 | # cd /usr/local/openresty/lualib && strip -s $(find . -name "*.so" | xargs) 11 | 12 | 13 | # FROM alpine 14 | # LABEL maintainer="suconghou@gmail.com" 15 | # COPY --from=build /usr/lib/libgcc_s.so.1 /usr/lib/libgcc_s.so.1 16 | # COPY --from=build /usr/local/openresty/luajit/lib/libluajit-5.1.so.2.1.0 /usr/local/openresty/luajit/lib/libluajit-5.1.so.2 17 | # COPY --from=build /usr/local/openresty/nginx/sbin/nginx /usr/local/sbin/nginx 18 | # COPY --from=build /usr/local/openresty/nginx/conf/nginx.conf usr/local/openresty/nginx/conf/fastcgi.conf /usr/local/openresty/nginx/conf/mime.types /usr/local/openresty/nginx/conf/scgi_params /usr/local/openresty/nginx/conf/ 19 | # COPY --from=build /usr/local/openresty/nginx/logs/ /usr/local/openresty/nginx/logs/ 20 | # COPY --from=build /usr/local/openresty/lualib /usr/local/openresty/lualib 21 | # RUN ln -sf /dev/stdout /usr/local/openresty/nginx/logs/access.log && \ 22 | # ln -sf /dev/stderr /usr/local/openresty/nginx/logs/error.log 23 | -------------------------------------------------------------------------------- /openresty/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/openresty -t=suconghou/openresty:1.27.1.2 . 3 | -------------------------------------------------------------------------------- /php/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | *.MD 3 | -------------------------------------------------------------------------------- /php/81/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make cmake wget file xz bison autoconf pcre-dev zlib-dev zlib-static libjpeg-turbo-dev libjpeg-turbo-static libpng-static libpng-dev bzip2-dev bzip2-static openssl-dev openssl-libs-static sqlite-dev sqlite-static oniguruma-dev libsodium-dev libsodium-static c-ares-dev c-ares-static linux-headers 4 | RUN LIBXML2_VERSION=libxml2-2.9.12 && wget http://xmlsoft.org/sources/${LIBXML2_VERSION}.tar.gz && tar zxf ${LIBXML2_VERSION}.tar.gz && cd ${LIBXML2_VERSION} && ./configure && make -j$(nproc) && make install 5 | RUN LIBXSLT_VERSION=libxslt-1.1.34 && wget http://xmlsoft.org/sources/${LIBXSLT_VERSION}.tar.gz && tar zxf ${LIBXSLT_VERSION}.tar.gz && cd ${LIBXSLT_VERSION} && ./configure && make -j$(nproc) && make install 6 | RUN CURL_VERSION=curl-8.15.0 && wget --no-check-certificate https://curl.haxx.se/download/${CURL_VERSION}.tar.xz && tar Jxf ${CURL_VERSION}.tar.xz && cd ${CURL_VERSION} && ./configure --with-openssl --enable-ares && make -j$(nproc) && make install 7 | RUN LIBFREETYPE_VERSION=freetype-2.13.3 && wget --no-check-certificate https://download-mirror.savannah.gnu.org/releases/freetype/${LIBFREETYPE_VERSION}.tar.gz && tar zxf ${LIBFREETYPE_VERSION}.tar.gz && cd ${LIBFREETYPE_VERSION} && ./configure && make -j$(nproc) && make install && ln -s $(pwd)/builds/unix/freetype-config /usr/local/bin/freetype-config 8 | RUN LIBZIP_VERSION=libzip-1.11.2 && wget --no-check-certificate https://libzip.org/download/${LIBZIP_VERSION}.tar.xz && tar Jxf ${LIBZIP_VERSION}.tar.xz && cd ${LIBZIP_VERSION} && mkdir build && cd build && cmake .. -DBUILD_SHARED_LIBS=OFF && make -j$(nproc) && make install 9 | RUN PHP_VERSION=php-8.1.30 && wget https://www.php.net/distributions/${PHP_VERSION}.tar.xz && tar xJf ${PHP_VERSION}.tar.xz && cd ${PHP_VERSION} && \ 10 | export CFLAGS="-O3" && LDFLAGS="-static" LIBS="$(curl-config --static-libs)" && \ 11 | export LIBZIP_LIBS="-L/usr/local/lib64 -lzip" && \ 12 | export LIBZIP_CFLAGS=-I/usr/local/include && \ 13 | ./configure --enable-inline-optimization --enable-static=yes --enable-shared=no --prefix=/usr/local --with-config-file-path=/etc --without-pear --disable-cgi --disable-opcache --enable-fpm --disable-phpdbg --enable-pcntl --enable-sockets --enable-ftp --enable-bcmath --with-zip --with-zlib --enable-mbstring --enable-gd --with-freetype --with-jpeg --with-mysqli --with-pdo-mysql --with-openssl --enable-exif --enable-calendar --with-bz2 --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-shmop --with-xsl --with-sodium --with-curl=/usr/local/ && \ 14 | sed -i "s{-export-dynamic{-all-static{" Makefile && make -j$(nproc) && make install 15 | RUN cd php-8.*.* && mv /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf && mv /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf && mkdir -p /var/log/php-fpm && \ 16 | sed -i '/^;error_log.*/cerror_log = \/var\/log\/php-fpm\/php-fpm.log' /usr/local/etc/php-fpm.conf && \ 17 | sed -i '/^;pid.*/cpid = \/var\/run\/php-fpm.pid' /usr/local/etc/php-fpm.conf && \ 18 | sed -i '/^;slowlog.*/cslowlog = \/var\/log\/php-fpm\/$pool.log.slow' /usr/local/etc/php-fpm.d/www.conf && \ 19 | sed -i '/^;request_slowlog_timeout =.*/crequest_slowlog_timeout = 5' /usr/local/etc/php-fpm.d/www.conf && \ 20 | sed -i '/^;request_terminate_timeout =.*/crequest_terminate_timeout = 60' /usr/local/etc/php-fpm.d/www.conf && \ 21 | php-fpm -t && strip -s /usr/local/sbin/php-fpm && strip -s /usr/local/bin/php && mv php.ini-development /etc/ && mv php.ini-production /etc/php.ini && \ 22 | sed -i '/^expose_php.*/cexpose_php = Off' /etc/php.ini 23 | 24 | FROM alpine 25 | LABEL maintainer="suconghou@gmail.com" 26 | COPY --from=build /usr/local/sbin/php-fpm /usr/local/sbin/php-fpm 27 | COPY --from=build /usr/local/bin/php /usr/local/bin/php 28 | COPY --from=build /usr/local/etc/php-fpm.conf /usr/local/etc/php-fpm.conf 29 | COPY --from=build /usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/ 30 | COPY --from=build /etc/php.ini /etc/php.ini 31 | COPY --from=build /etc/php.ini-development /etc/php.ini-development 32 | COPY --from=build /var/log/php-fpm /var/log/php-fpm 33 | EXPOSE 9000 34 | -------------------------------------------------------------------------------- /php/81/Dockerfile-mongo: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make cmake wget file xz bison autoconf pcre-dev zlib-dev zlib-static libjpeg-turbo-dev libjpeg-turbo-static libpng-static libpng-dev bzip2-dev bzip2-static openssl-dev openssl-libs-static sqlite-dev sqlite-static oniguruma-dev libsodium-dev libsodium-static c-ares-dev c-ares-static linux-headers 4 | RUN LIBXML2_VERSION=libxml2-2.9.12 && wget http://xmlsoft.org/sources/${LIBXML2_VERSION}.tar.gz && tar zxf ${LIBXML2_VERSION}.tar.gz && cd ${LIBXML2_VERSION} && ./configure && make -j$(nproc) && make install 5 | RUN LIBXSLT_VERSION=libxslt-1.1.34 && wget http://xmlsoft.org/sources/${LIBXSLT_VERSION}.tar.gz && tar zxf ${LIBXSLT_VERSION}.tar.gz && cd ${LIBXSLT_VERSION} && ./configure && make -j$(nproc) && make install 6 | RUN CURL_VERSION=curl-8.15.0 && wget --no-check-certificate https://curl.haxx.se/download/${CURL_VERSION}.tar.xz && tar Jxf ${CURL_VERSION}.tar.xz && cd ${CURL_VERSION} && ./configure --with-openssl --enable-ares && make -j$(nproc) && make install 7 | RUN LIBFREETYPE_VERSION=freetype-2.13.3 && wget --no-check-certificate https://download-mirror.savannah.gnu.org/releases/freetype/${LIBFREETYPE_VERSION}.tar.gz && tar zxf ${LIBFREETYPE_VERSION}.tar.gz && cd ${LIBFREETYPE_VERSION} && ./configure && make -j$(nproc) && make install && ln -s $(pwd)/builds/unix/freetype-config /usr/local/bin/freetype-config 8 | RUN LIBZIP_VERSION=libzip-1.11.2 && wget --no-check-certificate https://libzip.org/download/${LIBZIP_VERSION}.tar.xz && tar Jxf ${LIBZIP_VERSION}.tar.xz && cd ${LIBZIP_VERSION} && mkdir build && cd build && cmake .. -DBUILD_SHARED_LIBS=OFF && make -j$(nproc) && make install 9 | RUN IMAGEMAGICK_VERSION=7.1.1-41 && wget -O- https://github.com/ImageMagick/ImageMagick/archive/${IMAGEMAGICK_VERSION}.tar.gz | tar xz && cd ImageMagick-${IMAGEMAGICK_VERSION} && ./configure --without-threads --without-fftw --without-perl --disable-opencl --without-modules --without-zip && make -j$(nproc) && make install 10 | RUN PHP_VERSION=php-8.1.30 && wget https://www.php.net/distributions/${PHP_VERSION}.tar.xz && tar xJf ${PHP_VERSION}.tar.xz && cd ${PHP_VERSION} 11 | RUN REDIS_VERSION=redis-6.1.0 && cd php-8.*.* && wget https://pecl.php.net/get/${REDIS_VERSION}.tgz && tar zxf ${REDIS_VERSION}.tgz && mv ${REDIS_VERSION} ext/php-redis 12 | RUN MSGPACK_VERSION=msgpack-3.0.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MSGPACK_VERSION}.tgz && tar zxf ${MSGPACK_VERSION}.tgz && mv ${MSGPACK_VERSION} ext/msgpack 13 | RUN IGBINARY_VERSION=igbinary-3.2.16 && cd php-8.*.* && wget https://pecl.php.net/get/${IGBINARY_VERSION}.tgz && tar zxf ${IGBINARY_VERSION}.tgz && mv ${IGBINARY_VERSION} ext/igbinary 14 | RUN IMAGICK_VERSION=imagick-3.7.0 && cd php-8.*.* && wget https://pecl.php.net/get/${IMAGICK_VERSION}.tgz && tar zxf ${IMAGICK_VERSION}.tgz && mv ${IMAGICK_VERSION} ext/imagick 15 | RUN APCU_VERSION=apcu-5.1.24 && cd php-8.*.* && wget https://pecl.php.net/get/${APCU_VERSION}.tgz && tar zxf ${APCU_VERSION}.tgz && mv ${APCU_VERSION} ext/apcu 16 | RUN MONGODB_VERSION=mongodb-1.20.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MONGODB_VERSION}.tgz && tar zxf ${MONGODB_VERSION}.tgz && mv ${MONGODB_VERSION} ext/mongodb 17 | RUN cd php-8.*.* && rm -rf configure && ./buildconf --force && \ 18 | export CFLAGS="-O3" && LDFLAGS="-static" LIBS="$(curl-config --static-libs)" && \ 19 | export LIBZIP_LIBS="-L/usr/local/lib64 -lzip" && \ 20 | export LIBZIP_CFLAGS=-I/usr/local/include && \ 21 | ./configure --enable-inline-optimization --enable-static=yes --enable-shared=no --prefix=/usr/local --with-config-file-path=/etc --without-pear --disable-cgi --disable-opcache --enable-fpm --disable-phpdbg --enable-igbinary --with-msgpack --enable-redis --enable-redis-igbinary --enable-apcu --enable-pcntl --enable-sockets --enable-ftp --enable-bcmath --with-zip --with-zlib --enable-mbstring --with-imagick --enable-gd --with-freetype --with-jpeg --with-mysqli --with-pdo-mysql --with-openssl --enable-exif --enable-calendar --with-bz2 --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-shmop --with-xsl --with-sodium --with-curl=/usr/local/ --enable-mongodb && \ 22 | sed -i "s{-export-dynamic{-all-static{" Makefile && make -j$(nproc) && make install 23 | RUN cd php-8.*.* && mv /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf && mv /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf && mkdir -p /var/log/php-fpm && \ 24 | sed -i '/^;error_log.*/cerror_log = \/var\/log\/php-fpm\/php-fpm.log' /usr/local/etc/php-fpm.conf && \ 25 | sed -i '/^;pid.*/cpid = \/var\/run\/php-fpm.pid' /usr/local/etc/php-fpm.conf && \ 26 | sed -i '/^;slowlog.*/cslowlog = \/var\/log\/php-fpm\/$pool.log.slow' /usr/local/etc/php-fpm.d/www.conf && \ 27 | sed -i '/^;request_slowlog_timeout =.*/crequest_slowlog_timeout = 5' /usr/local/etc/php-fpm.d/www.conf && \ 28 | sed -i '/^;request_terminate_timeout =.*/crequest_terminate_timeout = 60' /usr/local/etc/php-fpm.d/www.conf && \ 29 | php-fpm -t && strip -s /usr/local/sbin/php-fpm && strip -s /usr/local/bin/php && mv php.ini-development /etc/ && mv php.ini-production /etc/php.ini && \ 30 | sed -i '/^expose_php.*/cexpose_php = Off' /etc/php.ini && sed -i '/^session.serialize_handler.*/csession.serialize_handler = igbinary' /etc/php.ini 31 | 32 | FROM alpine 33 | LABEL maintainer="suconghou@gmail.com" 34 | COPY --from=build /usr/local/sbin/php-fpm /usr/local/sbin/php-fpm 35 | COPY --from=build /usr/local/bin/php /usr/local/bin/php 36 | COPY --from=build /usr/local/etc/php-fpm.conf /usr/local/etc/php-fpm.conf 37 | COPY --from=build /usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/ 38 | COPY --from=build /etc/php.ini /etc/php.ini 39 | COPY --from=build /etc/php.ini-development /etc/php.ini-development 40 | COPY --from=build /var/log/php-fpm /var/log/php-fpm 41 | EXPOSE 9000 42 | 43 | -------------------------------------------------------------------------------- /php/81/Dockerfile-redis: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make cmake wget file xz bison autoconf pcre-dev zlib-dev zlib-static libjpeg-turbo-dev libjpeg-turbo-static libpng-static libpng-dev bzip2-dev bzip2-static openssl-dev openssl-libs-static sqlite-dev sqlite-static oniguruma-dev libsodium-dev libsodium-static c-ares-dev c-ares-static linux-headers 4 | RUN LIBXML2_VERSION=libxml2-2.9.12 && wget http://xmlsoft.org/sources/${LIBXML2_VERSION}.tar.gz && tar zxf ${LIBXML2_VERSION}.tar.gz && cd ${LIBXML2_VERSION} && ./configure && make -j$(nproc) && make install 5 | RUN LIBXSLT_VERSION=libxslt-1.1.34 && wget http://xmlsoft.org/sources/${LIBXSLT_VERSION}.tar.gz && tar zxf ${LIBXSLT_VERSION}.tar.gz && cd ${LIBXSLT_VERSION} && ./configure && make -j$(nproc) && make install 6 | RUN CURL_VERSION=curl-8.15.0 && wget --no-check-certificate https://curl.haxx.se/download/${CURL_VERSION}.tar.xz && tar Jxf ${CURL_VERSION}.tar.xz && cd ${CURL_VERSION} && ./configure --with-openssl --enable-ares && make -j$(nproc) && make install 7 | RUN LIBFREETYPE_VERSION=freetype-2.13.3 && wget --no-check-certificate https://download-mirror.savannah.gnu.org/releases/freetype/${LIBFREETYPE_VERSION}.tar.gz && tar zxf ${LIBFREETYPE_VERSION}.tar.gz && cd ${LIBFREETYPE_VERSION} && ./configure && make -j$(nproc) && make install && ln -s $(pwd)/builds/unix/freetype-config /usr/local/bin/freetype-config 8 | RUN LIBZIP_VERSION=libzip-1.11.2 && wget --no-check-certificate https://libzip.org/download/${LIBZIP_VERSION}.tar.xz && tar Jxf ${LIBZIP_VERSION}.tar.xz && cd ${LIBZIP_VERSION} && mkdir build && cd build && cmake .. -DBUILD_SHARED_LIBS=OFF && make -j$(nproc) && make install 9 | RUN IMAGEMAGICK_VERSION=7.1.1-41 && wget -O- https://github.com/ImageMagick/ImageMagick/archive/${IMAGEMAGICK_VERSION}.tar.gz | tar xz && cd ImageMagick-${IMAGEMAGICK_VERSION} && ./configure --without-threads --without-fftw --without-perl --disable-opencl --without-modules --without-zip && make -j$(nproc) && make install 10 | RUN PHP_VERSION=php-8.1.30 && wget https://www.php.net/distributions/${PHP_VERSION}.tar.xz && tar xJf ${PHP_VERSION}.tar.xz && cd ${PHP_VERSION} 11 | RUN REDIS_VERSION=redis-6.1.0 && cd php-8.*.* && wget https://pecl.php.net/get/${REDIS_VERSION}.tgz && tar zxf ${REDIS_VERSION}.tgz && mv ${REDIS_VERSION} ext/php-redis 12 | RUN MSGPACK_VERSION=msgpack-3.0.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MSGPACK_VERSION}.tgz && tar zxf ${MSGPACK_VERSION}.tgz && mv ${MSGPACK_VERSION} ext/msgpack 13 | RUN IGBINARY_VERSION=igbinary-3.2.16 && cd php-8.*.* && wget https://pecl.php.net/get/${IGBINARY_VERSION}.tgz && tar zxf ${IGBINARY_VERSION}.tgz && mv ${IGBINARY_VERSION} ext/igbinary 14 | RUN IMAGICK_VERSION=imagick-3.7.0 && cd php-8.*.* && wget https://pecl.php.net/get/${IMAGICK_VERSION}.tgz && tar zxf ${IMAGICK_VERSION}.tgz && mv ${IMAGICK_VERSION} ext/imagick 15 | RUN APCU_VERSION=apcu-5.1.24 && cd php-8.*.* && wget https://pecl.php.net/get/${APCU_VERSION}.tgz && tar zxf ${APCU_VERSION}.tgz && mv ${APCU_VERSION} ext/apcu 16 | RUN cd php-8.*.* && rm -rf configure && ./buildconf --force && \ 17 | export CFLAGS="-O3" && LDFLAGS="-static" LIBS="$(curl-config --static-libs)" && \ 18 | export LIBZIP_LIBS="-L/usr/local/lib64 -lzip" && \ 19 | export LIBZIP_CFLAGS=-I/usr/local/include && \ 20 | ./configure --enable-inline-optimization --enable-static=yes --enable-shared=no --prefix=/usr/local --with-config-file-path=/etc --without-pear --disable-cgi --disable-opcache --enable-fpm --disable-phpdbg --enable-igbinary --with-msgpack --enable-redis --enable-redis-igbinary --enable-apcu --enable-pcntl --enable-sockets --enable-ftp --enable-bcmath --with-zip --with-zlib --enable-mbstring --with-imagick --enable-gd --with-freetype --with-jpeg --with-mysqli --with-pdo-mysql --with-openssl --enable-exif --enable-calendar --with-bz2 --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-shmop --with-xsl --with-sodium --with-curl=/usr/local/ && \ 21 | sed -i "s{-export-dynamic{-all-static{" Makefile && make -j$(nproc) && make install 22 | RUN cd php-8.*.* && mv /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf && mv /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf && mkdir -p /var/log/php-fpm && \ 23 | sed -i '/^;error_log.*/cerror_log = \/var\/log\/php-fpm\/php-fpm.log' /usr/local/etc/php-fpm.conf && \ 24 | sed -i '/^;pid.*/cpid = \/var\/run\/php-fpm.pid' /usr/local/etc/php-fpm.conf && \ 25 | sed -i '/^;slowlog.*/cslowlog = \/var\/log\/php-fpm\/$pool.log.slow' /usr/local/etc/php-fpm.d/www.conf && \ 26 | sed -i '/^;request_slowlog_timeout =.*/crequest_slowlog_timeout = 5' /usr/local/etc/php-fpm.d/www.conf && \ 27 | sed -i '/^;request_terminate_timeout =.*/crequest_terminate_timeout = 60' /usr/local/etc/php-fpm.d/www.conf && \ 28 | php-fpm -t && strip -s /usr/local/sbin/php-fpm && strip -s /usr/local/bin/php && mv php.ini-development /etc/ && mv php.ini-production /etc/php.ini && \ 29 | sed -i '/^expose_php.*/cexpose_php = Off' /etc/php.ini && sed -i '/^session.serialize_handler.*/csession.serialize_handler = igbinary' /etc/php.ini 30 | 31 | FROM alpine 32 | LABEL maintainer="suconghou@gmail.com" 33 | COPY --from=build /usr/local/sbin/php-fpm /usr/local/sbin/php-fpm 34 | COPY --from=build /usr/local/bin/php /usr/local/bin/php 35 | COPY --from=build /usr/local/etc/php-fpm.conf /usr/local/etc/php-fpm.conf 36 | COPY --from=build /usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/ 37 | COPY --from=build /etc/php.ini /etc/php.ini 38 | COPY --from=build /etc/php.ini-development /etc/php.ini-development 39 | COPY --from=build /var/log/php-fpm /var/log/php-fpm 40 | EXPOSE 9000 41 | 42 | -------------------------------------------------------------------------------- /php/81/Dockerfile-swoole: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make cmake wget file xz bison autoconf pcre-dev zlib-dev zlib-static libjpeg-turbo-dev libjpeg-turbo-static libpng-static libpng-dev bzip2-dev bzip2-static openssl-dev openssl-libs-static sqlite-dev sqlite-static oniguruma-dev libsodium-dev libsodium-static c-ares-dev c-ares-static linux-headers 4 | RUN LIBXML2_VERSION=libxml2-2.9.12 && wget http://xmlsoft.org/sources/${LIBXML2_VERSION}.tar.gz && tar zxf ${LIBXML2_VERSION}.tar.gz && cd ${LIBXML2_VERSION} && ./configure && make -j$(nproc) && make install 5 | RUN LIBXSLT_VERSION=libxslt-1.1.34 && wget http://xmlsoft.org/sources/${LIBXSLT_VERSION}.tar.gz && tar zxf ${LIBXSLT_VERSION}.tar.gz && cd ${LIBXSLT_VERSION} && ./configure && make -j$(nproc) && make install 6 | RUN CURL_VERSION=curl-8.15.0 && wget --no-check-certificate https://curl.haxx.se/download/${CURL_VERSION}.tar.xz && tar Jxf ${CURL_VERSION}.tar.xz && cd ${CURL_VERSION} && ./configure --with-openssl --enable-ares && make -j$(nproc) && make install 7 | RUN LIBFREETYPE_VERSION=freetype-2.13.3 && wget --no-check-certificate https://download-mirror.savannah.gnu.org/releases/freetype/${LIBFREETYPE_VERSION}.tar.gz && tar zxf ${LIBFREETYPE_VERSION}.tar.gz && cd ${LIBFREETYPE_VERSION} && ./configure && make -j$(nproc) && make install && ln -s $(pwd)/builds/unix/freetype-config /usr/local/bin/freetype-config 8 | RUN LIBZIP_VERSION=libzip-1.11.2 && wget --no-check-certificate https://libzip.org/download/${LIBZIP_VERSION}.tar.xz && tar Jxf ${LIBZIP_VERSION}.tar.xz && cd ${LIBZIP_VERSION} && mkdir build && cd build && cmake .. -DBUILD_SHARED_LIBS=OFF && make -j$(nproc) && make install 9 | RUN IMAGEMAGICK_VERSION=7.1.1-41 && wget -O- https://github.com/ImageMagick/ImageMagick/archive/${IMAGEMAGICK_VERSION}.tar.gz | tar xz && cd ImageMagick-${IMAGEMAGICK_VERSION} && ./configure --without-threads --without-fftw --without-perl --disable-opencl --without-modules --without-zip && make -j$(nproc) && make install 10 | RUN PHP_VERSION=php-8.1.30 && wget https://www.php.net/distributions/${PHP_VERSION}.tar.xz && tar xJf ${PHP_VERSION}.tar.xz && cd ${PHP_VERSION} 11 | RUN REDIS_VERSION=redis-6.1.0 && cd php-8.*.* && wget https://pecl.php.net/get/${REDIS_VERSION}.tgz && tar zxf ${REDIS_VERSION}.tgz && mv ${REDIS_VERSION} ext/php-redis 12 | RUN MSGPACK_VERSION=msgpack-3.0.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MSGPACK_VERSION}.tgz && tar zxf ${MSGPACK_VERSION}.tgz && mv ${MSGPACK_VERSION} ext/msgpack 13 | RUN IGBINARY_VERSION=igbinary-3.2.16 && cd php-8.*.* && wget https://pecl.php.net/get/${IGBINARY_VERSION}.tgz && tar zxf ${IGBINARY_VERSION}.tgz && mv ${IGBINARY_VERSION} ext/igbinary 14 | RUN IMAGICK_VERSION=imagick-3.7.0 && cd php-8.*.* && wget https://pecl.php.net/get/${IMAGICK_VERSION}.tgz && tar zxf ${IMAGICK_VERSION}.tgz && mv ${IMAGICK_VERSION} ext/imagick 15 | RUN APCU_VERSION=apcu-5.1.24 && cd php-8.*.* && wget https://pecl.php.net/get/${APCU_VERSION}.tgz && tar zxf ${APCU_VERSION}.tgz && mv ${APCU_VERSION} ext/apcu 16 | RUN MONGODB_VERSION=mongodb-1.20.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MONGODB_VERSION}.tgz && tar zxf ${MONGODB_VERSION}.tgz && mv ${MONGODB_VERSION} ext/mongodb 17 | RUN SWOOLE_VERSION=swoole-5.1.5 && cd php-8.*.* && wget https://pecl.php.net/get/${SWOOLE_VERSION}.tgz && tar zxf ${SWOOLE_VERSION}.tgz && mv ${SWOOLE_VERSION} ext/swoole 18 | RUN cd php-8.*.* && rm -rf configure && ./buildconf --force && \ 19 | export CFLAGS="-O3" && LDFLAGS="-static" LIBS="$(curl-config --static-libs)" && \ 20 | export LIBZIP_LIBS="-L/usr/local/lib64 -lzip" && \ 21 | export LIBZIP_CFLAGS=-I/usr/local/include && \ 22 | ./configure --enable-inline-optimization --enable-static=yes --enable-shared=no --prefix=/usr/local --with-config-file-path=/etc --without-pear --disable-cgi --disable-opcache --disable-fpm --disable-phpdbg --enable-igbinary --with-msgpack --enable-redis --enable-redis-igbinary --enable-apcu --enable-pcntl --enable-sockets --enable-ftp --enable-bcmath --with-zip --with-zlib --enable-mbstring --with-imagick --enable-gd --with-freetype --with-jpeg --with-mysqli --with-pdo-mysql --enable-mysqlnd --with-openssl --enable-openssl --with-openssl-dir=/usr/ --enable-exif --enable-calendar --with-bz2 --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-shmop --with-xsl --with-sodium --with-curl=/usr/local/ --enable-cares --enable-mongodb && \ 23 | sed -i "s{-export-dynamic{-all-static{" Makefile && make -j$(nproc) && make install 24 | RUN cd php-8.*.* && \ 25 | strip -s /usr/local/bin/php && mv php.ini-production /etc/php.ini && \ 26 | sed -i '/^expose_php.*/cexpose_php = Off' /etc/php.ini && sed -i '/^session.serialize_handler.*/csession.serialize_handler = igbinary' /etc/php.ini 27 | 28 | FROM alpine 29 | LABEL maintainer="suconghou@gmail.com" 30 | COPY --from=build /usr/local/bin/php /usr/local/bin/php 31 | COPY --from=build /etc/php.ini /etc/php.ini 32 | EXPOSE 9000 33 | 34 | -------------------------------------------------------------------------------- /php/81/make-redis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/php:8.1.28_redis . -f Dockerfile-redis 3 | -------------------------------------------------------------------------------- /php/81/make-swoole.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/php:8.1.28_swoole_5.1.3 . -f Dockerfile-swoole 3 | -------------------------------------------------------------------------------- /php/81/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/php:8.1.30 . 3 | -------------------------------------------------------------------------------- /php/82/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make cmake wget file xz bison autoconf pcre-dev zlib-dev zlib-static libjpeg-turbo-dev libjpeg-turbo-static libpng-static libpng-dev bzip2-dev bzip2-static openssl-dev openssl-libs-static sqlite-dev sqlite-static oniguruma-dev libsodium-dev libsodium-static c-ares-dev c-ares-static linux-headers 4 | RUN LIBXML2_VERSION=libxml2-2.9.12 && wget http://xmlsoft.org/sources/${LIBXML2_VERSION}.tar.gz && tar zxf ${LIBXML2_VERSION}.tar.gz && cd ${LIBXML2_VERSION} && ./configure && make -j$(nproc) && make install 5 | RUN LIBXSLT_VERSION=libxslt-1.1.34 && wget http://xmlsoft.org/sources/${LIBXSLT_VERSION}.tar.gz && tar zxf ${LIBXSLT_VERSION}.tar.gz && cd ${LIBXSLT_VERSION} && ./configure && make -j$(nproc) && make install 6 | RUN CURL_VERSION=curl-8.15.0 && wget --no-check-certificate https://curl.haxx.se/download/${CURL_VERSION}.tar.xz && tar Jxf ${CURL_VERSION}.tar.xz && cd ${CURL_VERSION} && ./configure --with-openssl --enable-ares && make -j$(nproc) && make install 7 | RUN LIBFREETYPE_VERSION=freetype-2.13.3 && wget --no-check-certificate https://download-mirror.savannah.gnu.org/releases/freetype/${LIBFREETYPE_VERSION}.tar.gz && tar zxf ${LIBFREETYPE_VERSION}.tar.gz && cd ${LIBFREETYPE_VERSION} && ./configure && make -j$(nproc) && make install && ln -s $(pwd)/builds/unix/freetype-config /usr/local/bin/freetype-config 8 | RUN LIBZIP_VERSION=libzip-1.11.2 && wget --no-check-certificate https://libzip.org/download/${LIBZIP_VERSION}.tar.xz && tar Jxf ${LIBZIP_VERSION}.tar.xz && cd ${LIBZIP_VERSION} && mkdir build && cd build && cmake .. -DBUILD_SHARED_LIBS=OFF && make -j$(nproc) && make install 9 | RUN PHP_VERSION=php-8.2.25 && wget https://www.php.net/distributions/${PHP_VERSION}.tar.xz && tar xJf ${PHP_VERSION}.tar.xz && cd ${PHP_VERSION} && \ 10 | export CFLAGS="-O3" && LDFLAGS="-static" LIBS="$(curl-config --static-libs)" && \ 11 | export LIBZIP_LIBS="-L/usr/local/lib64 -lzip" && \ 12 | export LIBZIP_CFLAGS=-I/usr/local/include && \ 13 | ./configure --enable-inline-optimization --enable-static=yes --enable-shared=no --prefix=/usr/local --with-config-file-path=/etc --without-pear --disable-cgi --disable-opcache --enable-fpm --disable-phpdbg --enable-pcntl --enable-sockets --enable-ftp --enable-bcmath --with-zip --with-zlib --enable-mbstring --enable-gd --with-freetype --with-jpeg --with-mysqli --with-pdo-mysql --with-openssl --enable-exif --enable-calendar --with-bz2 --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-shmop --with-xsl --with-sodium --with-curl=/usr/local/ && \ 14 | sed -i "s{-export-dynamic{-all-static{" Makefile && make -j$(nproc) && make install 15 | RUN cd php-8.*.* && mv /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf && mv /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf && mkdir -p /var/log/php-fpm && \ 16 | sed -i '/^;error_log.*/cerror_log = \/var\/log\/php-fpm\/php-fpm.log' /usr/local/etc/php-fpm.conf && \ 17 | sed -i '/^;pid.*/cpid = \/var\/run\/php-fpm.pid' /usr/local/etc/php-fpm.conf && \ 18 | sed -i '/^;slowlog.*/cslowlog = \/var\/log\/php-fpm\/$pool.log.slow' /usr/local/etc/php-fpm.d/www.conf && \ 19 | sed -i '/^;request_slowlog_timeout =.*/crequest_slowlog_timeout = 5' /usr/local/etc/php-fpm.d/www.conf && \ 20 | sed -i '/^;request_terminate_timeout =.*/crequest_terminate_timeout = 60' /usr/local/etc/php-fpm.d/www.conf && \ 21 | php-fpm -t && strip -s /usr/local/sbin/php-fpm && strip -s /usr/local/bin/php && mv php.ini-development /etc/ && mv php.ini-production /etc/php.ini && \ 22 | sed -i '/^expose_php.*/cexpose_php = Off' /etc/php.ini 23 | 24 | FROM alpine 25 | LABEL maintainer="suconghou@gmail.com" 26 | COPY --from=build /usr/local/sbin/php-fpm /usr/local/sbin/php-fpm 27 | COPY --from=build /usr/local/bin/php /usr/local/bin/php 28 | COPY --from=build /usr/local/etc/php-fpm.conf /usr/local/etc/php-fpm.conf 29 | COPY --from=build /usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/ 30 | COPY --from=build /etc/php.ini /etc/php.ini 31 | COPY --from=build /etc/php.ini-development /etc/php.ini-development 32 | COPY --from=build /var/log/php-fpm /var/log/php-fpm 33 | EXPOSE 9000 34 | -------------------------------------------------------------------------------- /php/82/Dockerfile-mongo: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make cmake wget file xz bison autoconf pcre-dev zlib-dev zlib-static libjpeg-turbo-dev libjpeg-turbo-static libpng-static libpng-dev bzip2-dev bzip2-static openssl-dev openssl-libs-static sqlite-dev sqlite-static oniguruma-dev libsodium-dev libsodium-static c-ares-dev c-ares-static linux-headers 4 | RUN LIBXML2_VERSION=libxml2-2.9.12 && wget http://xmlsoft.org/sources/${LIBXML2_VERSION}.tar.gz && tar zxf ${LIBXML2_VERSION}.tar.gz && cd ${LIBXML2_VERSION} && ./configure && make -j$(nproc) && make install 5 | RUN LIBXSLT_VERSION=libxslt-1.1.34 && wget http://xmlsoft.org/sources/${LIBXSLT_VERSION}.tar.gz && tar zxf ${LIBXSLT_VERSION}.tar.gz && cd ${LIBXSLT_VERSION} && ./configure && make -j$(nproc) && make install 6 | RUN CURL_VERSION=curl-8.15.0 && wget --no-check-certificate https://curl.haxx.se/download/${CURL_VERSION}.tar.xz && tar Jxf ${CURL_VERSION}.tar.xz && cd ${CURL_VERSION} && ./configure --with-openssl --enable-ares && make -j$(nproc) && make install 7 | RUN LIBFREETYPE_VERSION=freetype-2.13.3 && wget --no-check-certificate https://download-mirror.savannah.gnu.org/releases/freetype/${LIBFREETYPE_VERSION}.tar.gz && tar zxf ${LIBFREETYPE_VERSION}.tar.gz && cd ${LIBFREETYPE_VERSION} && ./configure && make -j$(nproc) && make install && ln -s $(pwd)/builds/unix/freetype-config /usr/local/bin/freetype-config 8 | RUN LIBZIP_VERSION=libzip-1.11.2 && wget --no-check-certificate https://libzip.org/download/${LIBZIP_VERSION}.tar.xz && tar Jxf ${LIBZIP_VERSION}.tar.xz && cd ${LIBZIP_VERSION} && mkdir build && cd build && cmake .. -DBUILD_SHARED_LIBS=OFF && make -j$(nproc) && make install 9 | RUN IMAGEMAGICK_VERSION=7.1.1-41 && wget -O- https://github.com/ImageMagick/ImageMagick/archive/${IMAGEMAGICK_VERSION}.tar.gz | tar xz && cd ImageMagick-${IMAGEMAGICK_VERSION} && ./configure --without-threads --without-fftw --without-perl --disable-opencl --without-modules --without-zip && make -j$(nproc) && make install 10 | RUN PHP_VERSION=php-8.2.25 && wget https://www.php.net/distributions/${PHP_VERSION}.tar.xz && tar xJf ${PHP_VERSION}.tar.xz && cd ${PHP_VERSION} 11 | RUN REDIS_VERSION=redis-6.1.0 && cd php-8.*.* && wget https://pecl.php.net/get/${REDIS_VERSION}.tgz && tar zxf ${REDIS_VERSION}.tgz && mv ${REDIS_VERSION} ext/php-redis 12 | RUN MSGPACK_VERSION=msgpack-3.0.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MSGPACK_VERSION}.tgz && tar zxf ${MSGPACK_VERSION}.tgz && mv ${MSGPACK_VERSION} ext/msgpack 13 | RUN IGBINARY_VERSION=igbinary-3.2.16 && cd php-8.*.* && wget https://pecl.php.net/get/${IGBINARY_VERSION}.tgz && tar zxf ${IGBINARY_VERSION}.tgz && mv ${IGBINARY_VERSION} ext/igbinary 14 | RUN IMAGICK_VERSION=imagick-3.7.0 && cd php-8.*.* && wget https://pecl.php.net/get/${IMAGICK_VERSION}.tgz && tar zxf ${IMAGICK_VERSION}.tgz && mv ${IMAGICK_VERSION} ext/imagick 15 | RUN APCU_VERSION=apcu-5.1.24 && cd php-8.*.* && wget https://pecl.php.net/get/${APCU_VERSION}.tgz && tar zxf ${APCU_VERSION}.tgz && mv ${APCU_VERSION} ext/apcu 16 | RUN MONGODB_VERSION=mongodb-1.20.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MONGODB_VERSION}.tgz && tar zxf ${MONGODB_VERSION}.tgz && mv ${MONGODB_VERSION} ext/mongodb 17 | RUN cd php-8.*.* && rm -rf configure && ./buildconf --force && \ 18 | export CFLAGS="-O3" && LDFLAGS="-static" LIBS="$(curl-config --static-libs)" && \ 19 | export LIBZIP_LIBS="-L/usr/local/lib64 -lzip" && \ 20 | export LIBZIP_CFLAGS=-I/usr/local/include && \ 21 | ./configure --enable-inline-optimization --enable-static=yes --enable-shared=no --prefix=/usr/local --with-config-file-path=/etc --without-pear --disable-cgi --disable-opcache --enable-fpm --disable-phpdbg --enable-igbinary --with-msgpack --enable-redis --enable-redis-igbinary --enable-apcu --enable-pcntl --enable-sockets --enable-ftp --enable-bcmath --with-zip --with-zlib --enable-mbstring --with-imagick --enable-gd --with-freetype --with-jpeg --with-mysqli --with-pdo-mysql --with-openssl --enable-exif --enable-calendar --with-bz2 --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-shmop --with-xsl --with-sodium --with-curl=/usr/local/ --enable-mongodb && \ 22 | sed -i "s{-export-dynamic{-all-static{" Makefile && make -j$(nproc) && make install 23 | RUN cd php-8.*.* && mv /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf && mv /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf && mkdir -p /var/log/php-fpm && \ 24 | sed -i '/^;error_log.*/cerror_log = \/var\/log\/php-fpm\/php-fpm.log' /usr/local/etc/php-fpm.conf && \ 25 | sed -i '/^;pid.*/cpid = \/var\/run\/php-fpm.pid' /usr/local/etc/php-fpm.conf && \ 26 | sed -i '/^;slowlog.*/cslowlog = \/var\/log\/php-fpm\/$pool.log.slow' /usr/local/etc/php-fpm.d/www.conf && \ 27 | sed -i '/^;request_slowlog_timeout =.*/crequest_slowlog_timeout = 5' /usr/local/etc/php-fpm.d/www.conf && \ 28 | sed -i '/^;request_terminate_timeout =.*/crequest_terminate_timeout = 60' /usr/local/etc/php-fpm.d/www.conf && \ 29 | php-fpm -t && strip -s /usr/local/sbin/php-fpm && strip -s /usr/local/bin/php && mv php.ini-development /etc/ && mv php.ini-production /etc/php.ini && \ 30 | sed -i '/^expose_php.*/cexpose_php = Off' /etc/php.ini && sed -i '/^session.serialize_handler.*/csession.serialize_handler = igbinary' /etc/php.ini 31 | 32 | FROM alpine 33 | LABEL maintainer="suconghou@gmail.com" 34 | COPY --from=build /usr/local/sbin/php-fpm /usr/local/sbin/php-fpm 35 | COPY --from=build /usr/local/bin/php /usr/local/bin/php 36 | COPY --from=build /usr/local/etc/php-fpm.conf /usr/local/etc/php-fpm.conf 37 | COPY --from=build /usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/ 38 | COPY --from=build /etc/php.ini /etc/php.ini 39 | COPY --from=build /etc/php.ini-development /etc/php.ini-development 40 | COPY --from=build /var/log/php-fpm /var/log/php-fpm 41 | EXPOSE 9000 42 | 43 | -------------------------------------------------------------------------------- /php/82/Dockerfile-redis: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make cmake wget file xz bison autoconf pcre-dev zlib-dev zlib-static libjpeg-turbo-dev libjpeg-turbo-static libpng-static libpng-dev bzip2-dev bzip2-static openssl-dev openssl-libs-static sqlite-dev sqlite-static oniguruma-dev libsodium-dev libsodium-static c-ares-dev c-ares-static linux-headers 4 | RUN LIBXML2_VERSION=libxml2-2.9.12 && wget http://xmlsoft.org/sources/${LIBXML2_VERSION}.tar.gz && tar zxf ${LIBXML2_VERSION}.tar.gz && cd ${LIBXML2_VERSION} && ./configure && make -j$(nproc) && make install 5 | RUN LIBXSLT_VERSION=libxslt-1.1.34 && wget http://xmlsoft.org/sources/${LIBXSLT_VERSION}.tar.gz && tar zxf ${LIBXSLT_VERSION}.tar.gz && cd ${LIBXSLT_VERSION} && ./configure && make -j$(nproc) && make install 6 | RUN CURL_VERSION=curl-8.15.0 && wget --no-check-certificate https://curl.haxx.se/download/${CURL_VERSION}.tar.xz && tar Jxf ${CURL_VERSION}.tar.xz && cd ${CURL_VERSION} && ./configure --with-openssl --enable-ares && make -j$(nproc) && make install 7 | RUN LIBFREETYPE_VERSION=freetype-2.13.3 && wget --no-check-certificate https://download-mirror.savannah.gnu.org/releases/freetype/${LIBFREETYPE_VERSION}.tar.gz && tar zxf ${LIBFREETYPE_VERSION}.tar.gz && cd ${LIBFREETYPE_VERSION} && ./configure && make -j$(nproc) && make install && ln -s $(pwd)/builds/unix/freetype-config /usr/local/bin/freetype-config 8 | RUN LIBZIP_VERSION=libzip-1.11.2 && wget --no-check-certificate https://libzip.org/download/${LIBZIP_VERSION}.tar.xz && tar Jxf ${LIBZIP_VERSION}.tar.xz && cd ${LIBZIP_VERSION} && mkdir build && cd build && cmake .. -DBUILD_SHARED_LIBS=OFF && make -j$(nproc) && make install 9 | RUN IMAGEMAGICK_VERSION=7.1.1-41 && wget -O- https://github.com/ImageMagick/ImageMagick/archive/${IMAGEMAGICK_VERSION}.tar.gz | tar xz && cd ImageMagick-${IMAGEMAGICK_VERSION} && ./configure --without-threads --without-fftw --without-perl --disable-opencl --without-modules --without-zip && make -j$(nproc) && make install 10 | RUN PHP_VERSION=php-8.2.25 && wget https://www.php.net/distributions/${PHP_VERSION}.tar.xz && tar xJf ${PHP_VERSION}.tar.xz && cd ${PHP_VERSION} 11 | RUN REDIS_VERSION=redis-6.1.0 && cd php-8.*.* && wget https://pecl.php.net/get/${REDIS_VERSION}.tgz && tar zxf ${REDIS_VERSION}.tgz && mv ${REDIS_VERSION} ext/php-redis 12 | RUN MSGPACK_VERSION=msgpack-3.0.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MSGPACK_VERSION}.tgz && tar zxf ${MSGPACK_VERSION}.tgz && mv ${MSGPACK_VERSION} ext/msgpack 13 | RUN IGBINARY_VERSION=igbinary-3.2.16 && cd php-8.*.* && wget https://pecl.php.net/get/${IGBINARY_VERSION}.tgz && tar zxf ${IGBINARY_VERSION}.tgz && mv ${IGBINARY_VERSION} ext/igbinary 14 | RUN IMAGICK_VERSION=imagick-3.7.0 && cd php-8.*.* && wget https://pecl.php.net/get/${IMAGICK_VERSION}.tgz && tar zxf ${IMAGICK_VERSION}.tgz && mv ${IMAGICK_VERSION} ext/imagick 15 | RUN APCU_VERSION=apcu-5.1.24 && cd php-8.*.* && wget https://pecl.php.net/get/${APCU_VERSION}.tgz && tar zxf ${APCU_VERSION}.tgz && mv ${APCU_VERSION} ext/apcu 16 | RUN cd php-8.*.* && rm -rf configure && ./buildconf --force && \ 17 | export CFLAGS="-O3" && LDFLAGS="-static" LIBS="$(curl-config --static-libs)" && \ 18 | export LIBZIP_LIBS="-L/usr/local/lib64 -lzip" && \ 19 | export LIBZIP_CFLAGS=-I/usr/local/include && \ 20 | ./configure --enable-inline-optimization --enable-static=yes --enable-shared=no --prefix=/usr/local --with-config-file-path=/etc --without-pear --disable-cgi --disable-opcache --enable-fpm --disable-phpdbg --enable-igbinary --with-msgpack --enable-redis --enable-redis-igbinary --enable-apcu --enable-pcntl --enable-sockets --enable-ftp --enable-bcmath --with-zip --with-zlib --enable-mbstring --with-imagick --enable-gd --with-freetype --with-jpeg --with-mysqli --with-pdo-mysql --with-openssl --enable-exif --enable-calendar --with-bz2 --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-shmop --with-xsl --with-sodium --with-curl=/usr/local/ && \ 21 | sed -i "s{-export-dynamic{-all-static{" Makefile && make -j$(nproc) && make install 22 | RUN cd php-8.*.* && mv /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf && mv /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf && mkdir -p /var/log/php-fpm && \ 23 | sed -i '/^;error_log.*/cerror_log = \/var\/log\/php-fpm\/php-fpm.log' /usr/local/etc/php-fpm.conf && \ 24 | sed -i '/^;pid.*/cpid = \/var\/run\/php-fpm.pid' /usr/local/etc/php-fpm.conf && \ 25 | sed -i '/^;slowlog.*/cslowlog = \/var\/log\/php-fpm\/$pool.log.slow' /usr/local/etc/php-fpm.d/www.conf && \ 26 | sed -i '/^;request_slowlog_timeout =.*/crequest_slowlog_timeout = 5' /usr/local/etc/php-fpm.d/www.conf && \ 27 | sed -i '/^;request_terminate_timeout =.*/crequest_terminate_timeout = 60' /usr/local/etc/php-fpm.d/www.conf && \ 28 | php-fpm -t && strip -s /usr/local/sbin/php-fpm && strip -s /usr/local/bin/php && mv php.ini-development /etc/ && mv php.ini-production /etc/php.ini && \ 29 | sed -i '/^expose_php.*/cexpose_php = Off' /etc/php.ini && sed -i '/^session.serialize_handler.*/csession.serialize_handler = igbinary' /etc/php.ini 30 | 31 | FROM alpine 32 | LABEL maintainer="suconghou@gmail.com" 33 | COPY --from=build /usr/local/sbin/php-fpm /usr/local/sbin/php-fpm 34 | COPY --from=build /usr/local/bin/php /usr/local/bin/php 35 | COPY --from=build /usr/local/etc/php-fpm.conf /usr/local/etc/php-fpm.conf 36 | COPY --from=build /usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/ 37 | COPY --from=build /etc/php.ini /etc/php.ini 38 | COPY --from=build /etc/php.ini-development /etc/php.ini-development 39 | COPY --from=build /var/log/php-fpm /var/log/php-fpm 40 | EXPOSE 9000 41 | 42 | -------------------------------------------------------------------------------- /php/82/Dockerfile-swoole: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make cmake wget file xz bison autoconf pcre-dev zlib-dev zlib-static libjpeg-turbo-dev libjpeg-turbo-static libpng-static libpng-dev bzip2-dev bzip2-static openssl-dev openssl-libs-static sqlite-dev sqlite-static oniguruma-dev libsodium-dev libsodium-static c-ares-dev c-ares-static linux-headers 4 | RUN LIBXML2_VERSION=libxml2-2.9.12 && wget http://xmlsoft.org/sources/${LIBXML2_VERSION}.tar.gz && tar zxf ${LIBXML2_VERSION}.tar.gz && cd ${LIBXML2_VERSION} && ./configure && make -j$(nproc) && make install 5 | RUN LIBXSLT_VERSION=libxslt-1.1.34 && wget http://xmlsoft.org/sources/${LIBXSLT_VERSION}.tar.gz && tar zxf ${LIBXSLT_VERSION}.tar.gz && cd ${LIBXSLT_VERSION} && ./configure && make -j$(nproc) && make install 6 | RUN CURL_VERSION=curl-8.15.0 && wget --no-check-certificate https://curl.haxx.se/download/${CURL_VERSION}.tar.xz && tar Jxf ${CURL_VERSION}.tar.xz && cd ${CURL_VERSION} && ./configure --with-openssl --enable-ares && make -j$(nproc) && make install 7 | RUN LIBFREETYPE_VERSION=freetype-2.13.3 && wget --no-check-certificate https://download-mirror.savannah.gnu.org/releases/freetype/${LIBFREETYPE_VERSION}.tar.gz && tar zxf ${LIBFREETYPE_VERSION}.tar.gz && cd ${LIBFREETYPE_VERSION} && ./configure && make -j$(nproc) && make install && ln -s $(pwd)/builds/unix/freetype-config /usr/local/bin/freetype-config 8 | RUN LIBZIP_VERSION=libzip-1.11.2 && wget --no-check-certificate https://libzip.org/download/${LIBZIP_VERSION}.tar.xz && tar Jxf ${LIBZIP_VERSION}.tar.xz && cd ${LIBZIP_VERSION} && mkdir build && cd build && cmake .. -DBUILD_SHARED_LIBS=OFF && make -j$(nproc) && make install 9 | RUN IMAGEMAGICK_VERSION=7.1.1-41 && wget -O- https://github.com/ImageMagick/ImageMagick/archive/${IMAGEMAGICK_VERSION}.tar.gz | tar xz && cd ImageMagick-${IMAGEMAGICK_VERSION} && ./configure --without-threads --without-fftw --without-perl --disable-opencl --without-modules --without-zip && make -j$(nproc) && make install 10 | RUN PHP_VERSION=php-8.2.25 && wget https://www.php.net/distributions/${PHP_VERSION}.tar.xz && tar xJf ${PHP_VERSION}.tar.xz && cd ${PHP_VERSION} 11 | RUN REDIS_VERSION=redis-6.1.0 && cd php-8.*.* && wget https://pecl.php.net/get/${REDIS_VERSION}.tgz && tar zxf ${REDIS_VERSION}.tgz && mv ${REDIS_VERSION} ext/php-redis 12 | RUN MSGPACK_VERSION=msgpack-3.0.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MSGPACK_VERSION}.tgz && tar zxf ${MSGPACK_VERSION}.tgz && mv ${MSGPACK_VERSION} ext/msgpack 13 | RUN IGBINARY_VERSION=igbinary-3.2.16 && cd php-8.*.* && wget https://pecl.php.net/get/${IGBINARY_VERSION}.tgz && tar zxf ${IGBINARY_VERSION}.tgz && mv ${IGBINARY_VERSION} ext/igbinary 14 | RUN IMAGICK_VERSION=imagick-3.7.0 && cd php-8.*.* && wget https://pecl.php.net/get/${IMAGICK_VERSION}.tgz && tar zxf ${IMAGICK_VERSION}.tgz && mv ${IMAGICK_VERSION} ext/imagick 15 | RUN APCU_VERSION=apcu-5.1.24 && cd php-8.*.* && wget https://pecl.php.net/get/${APCU_VERSION}.tgz && tar zxf ${APCU_VERSION}.tgz && mv ${APCU_VERSION} ext/apcu 16 | RUN MONGODB_VERSION=mongodb-1.20.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MONGODB_VERSION}.tgz && tar zxf ${MONGODB_VERSION}.tgz && mv ${MONGODB_VERSION} ext/mongodb 17 | RUN SWOOLE_VERSION=swoole-5.1.5 && cd php-8.*.* && wget https://pecl.php.net/get/${SWOOLE_VERSION}.tgz && tar zxf ${SWOOLE_VERSION}.tgz && mv ${SWOOLE_VERSION} ext/swoole 18 | RUN cd php-8.*.* && rm -rf configure && ./buildconf --force && \ 19 | export CFLAGS="-O3" && LDFLAGS="-static" LIBS="$(curl-config --static-libs)" && \ 20 | export LIBZIP_LIBS="-L/usr/local/lib64 -lzip" && \ 21 | export LIBZIP_CFLAGS=-I/usr/local/include && \ 22 | ./configure --enable-inline-optimization --enable-static=yes --enable-shared=no --prefix=/usr/local --with-config-file-path=/etc --without-pear --disable-cgi --disable-opcache --disable-fpm --disable-phpdbg --enable-igbinary --with-msgpack --enable-redis --enable-redis-igbinary --enable-apcu --enable-pcntl --enable-sockets --enable-ftp --enable-bcmath --with-zip --with-zlib --enable-mbstring --with-imagick --enable-gd --with-freetype --with-jpeg --with-mysqli --with-pdo-mysql --enable-mysqlnd --with-openssl --enable-openssl --with-openssl-dir=/usr/ --enable-exif --enable-calendar --with-bz2 --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-shmop --with-xsl --with-sodium --with-curl=/usr/local/ --enable-cares --enable-mongodb && \ 23 | sed -i "s{-export-dynamic{-all-static{" Makefile && make -j$(nproc) && make install 24 | RUN cd php-8.*.* && \ 25 | strip -s /usr/local/bin/php && mv php.ini-production /etc/php.ini && \ 26 | sed -i '/^expose_php.*/cexpose_php = Off' /etc/php.ini && sed -i '/^session.serialize_handler.*/csession.serialize_handler = igbinary' /etc/php.ini 27 | 28 | FROM alpine 29 | LABEL maintainer="suconghou@gmail.com" 30 | COPY --from=build /usr/local/bin/php /usr/local/bin/php 31 | COPY --from=build /etc/php.ini /etc/php.ini 32 | EXPOSE 9000 33 | 34 | -------------------------------------------------------------------------------- /php/82/make-redis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/php:8.2.19_redis . -f Dockerfile-redis 3 | -------------------------------------------------------------------------------- /php/82/make-swoole.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/php:8.2.19_swoole_5.1.3 . -f Dockerfile-swoole 3 | -------------------------------------------------------------------------------- /php/82/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/php:8.2.25 . 3 | -------------------------------------------------------------------------------- /php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make cmake wget file xz bison autoconf pcre-dev zlib-dev zlib-static libjpeg-turbo-dev libjpeg-turbo-static libpng-static libpng-dev bzip2-dev bzip2-static openssl-dev openssl-libs-static sqlite-dev sqlite-static oniguruma-dev libsodium-dev libsodium-static c-ares-dev c-ares-static linux-headers 4 | RUN LIBXML2_VERSION=libxml2-2.9.12 && wget http://xmlsoft.org/sources/${LIBXML2_VERSION}.tar.gz && tar zxf ${LIBXML2_VERSION}.tar.gz && cd ${LIBXML2_VERSION} && ./configure && make -j$(nproc) && make install 5 | RUN LIBXSLT_VERSION=libxslt-1.1.34 && wget http://xmlsoft.org/sources/${LIBXSLT_VERSION}.tar.gz && tar zxf ${LIBXSLT_VERSION}.tar.gz && cd ${LIBXSLT_VERSION} && ./configure && make -j$(nproc) && make install 6 | RUN CURL_VERSION=curl-8.15.0 && wget --no-check-certificate https://curl.haxx.se/download/${CURL_VERSION}.tar.xz && tar Jxf ${CURL_VERSION}.tar.xz && cd ${CURL_VERSION} && ./configure --with-openssl --enable-ares && make -j$(nproc) && make install 7 | RUN LIBFREETYPE_VERSION=freetype-2.13.3 && wget --no-check-certificate https://download-mirror.savannah.gnu.org/releases/freetype/${LIBFREETYPE_VERSION}.tar.gz && tar zxf ${LIBFREETYPE_VERSION}.tar.gz && cd ${LIBFREETYPE_VERSION} && ./configure && make -j$(nproc) && make install && ln -s $(pwd)/builds/unix/freetype-config /usr/local/bin/freetype-config 8 | RUN LIBZIP_VERSION=libzip-1.11.2 && wget --no-check-certificate https://libzip.org/download/${LIBZIP_VERSION}.tar.xz && tar Jxf ${LIBZIP_VERSION}.tar.xz && cd ${LIBZIP_VERSION} && mkdir build && cd build && cmake .. -DBUILD_SHARED_LIBS=OFF && make -j$(nproc) && make install 9 | RUN PHP_VERSION=php-8.3.13 && wget https://www.php.net/distributions/${PHP_VERSION}.tar.xz && tar xJf ${PHP_VERSION}.tar.xz && cd ${PHP_VERSION} && \ 10 | export CFLAGS="-O3" && LDFLAGS="-static" LIBS="$(curl-config --static-libs)" && \ 11 | export LIBZIP_LIBS="-L/usr/local/lib64 -lzip" && \ 12 | export LIBZIP_CFLAGS=-I/usr/local/include && \ 13 | ./configure --enable-inline-optimization --enable-static=yes --enable-shared=no --prefix=/usr/local --with-config-file-path=/etc --without-pear --disable-cgi --disable-opcache --enable-fpm --disable-phpdbg --enable-pcntl --enable-sockets --enable-ftp --enable-bcmath --with-zip --with-zlib --enable-mbstring --enable-gd --with-freetype --with-jpeg --with-mysqli --with-pdo-mysql --with-openssl --enable-exif --enable-calendar --with-bz2 --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-shmop --with-xsl --with-sodium --with-curl=/usr/local/ && \ 14 | sed -i "s{-export-dynamic{-all-static{" Makefile && make -j$(nproc) && make install 15 | RUN cd php-8.*.* && mv /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf && mv /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf && mkdir -p /var/log/php-fpm && \ 16 | sed -i '/^;error_log.*/cerror_log = \/var\/log\/php-fpm\/php-fpm.log' /usr/local/etc/php-fpm.conf && \ 17 | sed -i '/^;pid.*/cpid = \/var\/run\/php-fpm.pid' /usr/local/etc/php-fpm.conf && \ 18 | sed -i '/^;slowlog.*/cslowlog = \/var\/log\/php-fpm\/$pool.log.slow' /usr/local/etc/php-fpm.d/www.conf && \ 19 | sed -i '/^;request_slowlog_timeout =.*/crequest_slowlog_timeout = 5' /usr/local/etc/php-fpm.d/www.conf && \ 20 | sed -i '/^;request_terminate_timeout =.*/crequest_terminate_timeout = 60' /usr/local/etc/php-fpm.d/www.conf && \ 21 | php-fpm -t && strip -s /usr/local/sbin/php-fpm && strip -s /usr/local/bin/php && mv php.ini-development /etc/ && mv php.ini-production /etc/php.ini && \ 22 | sed -i '/^expose_php.*/cexpose_php = Off' /etc/php.ini 23 | 24 | FROM alpine 25 | LABEL maintainer="suconghou@gmail.com" 26 | COPY --from=build /usr/local/sbin/php-fpm /usr/local/sbin/php-fpm 27 | COPY --from=build /usr/local/bin/php /usr/local/bin/php 28 | COPY --from=build /usr/local/etc/php-fpm.conf /usr/local/etc/php-fpm.conf 29 | COPY --from=build /usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/ 30 | COPY --from=build /etc/php.ini /etc/php.ini 31 | COPY --from=build /etc/php.ini-development /etc/php.ini-development 32 | COPY --from=build /var/log/php-fpm /var/log/php-fpm 33 | EXPOSE 9000 34 | -------------------------------------------------------------------------------- /php/Dockerfile-cli: -------------------------------------------------------------------------------- 1 | FROM suconghou/php AS build 2 | RUN /usr/local/bin/php -v 3 | 4 | FROM alpine 5 | LABEL maintainer="suconghou@gmail.com" 6 | COPY --from=build /usr/local/bin/php /usr/local/bin/php 7 | COPY --from=build /etc/php.ini /etc/php.ini 8 | COPY --from=build /etc/php.ini-development /etc/php.ini-development 9 | -------------------------------------------------------------------------------- /php/Dockerfile-fpm: -------------------------------------------------------------------------------- 1 | FROM suconghou/php AS build 2 | RUN /usr/local/sbin/php-fpm -v 3 | 4 | FROM alpine 5 | LABEL maintainer="suconghou@gmail.com" 6 | COPY --from=build /usr/local/sbin/php-fpm /usr/local/sbin/php-fpm 7 | COPY --from=build /usr/local/etc/php-fpm.conf /usr/local/etc/php-fpm.conf 8 | COPY --from=build /usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/ 9 | COPY --from=build /etc/php.ini /etc/php.ini 10 | COPY --from=build /etc/php.ini-development /etc/php.ini-development 11 | COPY --from=build /var/log/php-fpm /var/log/php-fpm 12 | EXPOSE 9000 13 | -------------------------------------------------------------------------------- /php/Dockerfile-mongo: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make cmake wget file xz bison autoconf pcre-dev zlib-dev zlib-static libjpeg-turbo-dev libjpeg-turbo-static libpng-static libpng-dev bzip2-dev bzip2-static openssl-dev openssl-libs-static sqlite-dev sqlite-static oniguruma-dev libsodium-dev libsodium-static c-ares-dev c-ares-static linux-headers 4 | RUN LIBXML2_VERSION=libxml2-2.9.12 && wget http://xmlsoft.org/sources/${LIBXML2_VERSION}.tar.gz && tar zxf ${LIBXML2_VERSION}.tar.gz && cd ${LIBXML2_VERSION} && ./configure && make -j$(nproc) && make install 5 | RUN LIBXSLT_VERSION=libxslt-1.1.34 && wget http://xmlsoft.org/sources/${LIBXSLT_VERSION}.tar.gz && tar zxf ${LIBXSLT_VERSION}.tar.gz && cd ${LIBXSLT_VERSION} && ./configure && make -j$(nproc) && make install 6 | RUN CURL_VERSION=curl-8.15.0 && wget --no-check-certificate https://curl.haxx.se/download/${CURL_VERSION}.tar.xz && tar Jxf ${CURL_VERSION}.tar.xz && cd ${CURL_VERSION} && ./configure --with-openssl --enable-ares && make -j$(nproc) && make install 7 | RUN LIBFREETYPE_VERSION=freetype-2.13.3 && wget --no-check-certificate https://download-mirror.savannah.gnu.org/releases/freetype/${LIBFREETYPE_VERSION}.tar.gz && tar zxf ${LIBFREETYPE_VERSION}.tar.gz && cd ${LIBFREETYPE_VERSION} && ./configure && make -j$(nproc) && make install && ln -s $(pwd)/builds/unix/freetype-config /usr/local/bin/freetype-config 8 | RUN LIBZIP_VERSION=libzip-1.11.2 && wget --no-check-certificate https://libzip.org/download/${LIBZIP_VERSION}.tar.xz && tar Jxf ${LIBZIP_VERSION}.tar.xz && cd ${LIBZIP_VERSION} && mkdir build && cd build && cmake .. -DBUILD_SHARED_LIBS=OFF && make -j$(nproc) && make install 9 | RUN IMAGEMAGICK_VERSION=7.1.1-41 && wget -O- https://github.com/ImageMagick/ImageMagick/archive/${IMAGEMAGICK_VERSION}.tar.gz | tar xz && cd ImageMagick-${IMAGEMAGICK_VERSION} && ./configure --without-threads --without-fftw --without-perl --disable-opencl --without-modules --without-zip && make -j$(nproc) && make install 10 | RUN PHP_VERSION=php-8.3.13 && wget https://www.php.net/distributions/${PHP_VERSION}.tar.xz && tar xJf ${PHP_VERSION}.tar.xz && cd ${PHP_VERSION} 11 | RUN REDIS_VERSION=redis-6.1.0 && cd php-8.*.* && wget https://pecl.php.net/get/${REDIS_VERSION}.tgz && tar zxf ${REDIS_VERSION}.tgz && mv ${REDIS_VERSION} ext/php-redis 12 | RUN MSGPACK_VERSION=msgpack-3.0.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MSGPACK_VERSION}.tgz && tar zxf ${MSGPACK_VERSION}.tgz && mv ${MSGPACK_VERSION} ext/msgpack 13 | RUN IGBINARY_VERSION=igbinary-3.2.16 && cd php-8.*.* && wget https://pecl.php.net/get/${IGBINARY_VERSION}.tgz && tar zxf ${IGBINARY_VERSION}.tgz && mv ${IGBINARY_VERSION} ext/igbinary 14 | RUN IMAGICK_VERSION=imagick-3.7.0 && cd php-8.*.* && wget https://pecl.php.net/get/${IMAGICK_VERSION}.tgz && tar zxf ${IMAGICK_VERSION}.tgz && mv ${IMAGICK_VERSION} ext/imagick 15 | RUN APCU_VERSION=apcu-5.1.24 && cd php-8.*.* && wget https://pecl.php.net/get/${APCU_VERSION}.tgz && tar zxf ${APCU_VERSION}.tgz && mv ${APCU_VERSION} ext/apcu 16 | RUN MONGODB_VERSION=mongodb-1.20.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MONGODB_VERSION}.tgz && tar zxf ${MONGODB_VERSION}.tgz && mv ${MONGODB_VERSION} ext/mongodb 17 | RUN cd php-8.*.* && rm -rf configure && ./buildconf --force && \ 18 | export CFLAGS="-O3" && LDFLAGS="-static" LIBS="$(curl-config --static-libs)" && \ 19 | export LIBZIP_LIBS="-L/usr/local/lib64 -lzip" && \ 20 | export LIBZIP_CFLAGS=-I/usr/local/include && \ 21 | ./configure --enable-inline-optimization --enable-static=yes --enable-shared=no --prefix=/usr/local --with-config-file-path=/etc --without-pear --disable-cgi --disable-opcache --enable-fpm --disable-phpdbg --enable-igbinary --with-msgpack --enable-redis --enable-redis-igbinary --enable-apcu --enable-pcntl --enable-sockets --enable-ftp --enable-bcmath --with-zip --with-zlib --enable-mbstring --with-imagick --enable-gd --with-freetype --with-jpeg --with-mysqli --with-pdo-mysql --with-openssl --enable-exif --enable-calendar --with-bz2 --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-shmop --with-xsl --with-sodium --with-curl=/usr/local/ --enable-mongodb && \ 22 | sed -i "s{-export-dynamic{-all-static{" Makefile && make -j$(nproc) && make install 23 | RUN cd php-8.*.* && mv /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf && mv /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf && mkdir -p /var/log/php-fpm && \ 24 | sed -i '/^;error_log.*/cerror_log = \/var\/log\/php-fpm\/php-fpm.log' /usr/local/etc/php-fpm.conf && \ 25 | sed -i '/^;pid.*/cpid = \/var\/run\/php-fpm.pid' /usr/local/etc/php-fpm.conf && \ 26 | sed -i '/^;slowlog.*/cslowlog = \/var\/log\/php-fpm\/$pool.log.slow' /usr/local/etc/php-fpm.d/www.conf && \ 27 | sed -i '/^;request_slowlog_timeout =.*/crequest_slowlog_timeout = 5' /usr/local/etc/php-fpm.d/www.conf && \ 28 | sed -i '/^;request_terminate_timeout =.*/crequest_terminate_timeout = 60' /usr/local/etc/php-fpm.d/www.conf && \ 29 | php-fpm -t && strip -s /usr/local/sbin/php-fpm && strip -s /usr/local/bin/php && mv php.ini-development /etc/ && mv php.ini-production /etc/php.ini && \ 30 | sed -i '/^expose_php.*/cexpose_php = Off' /etc/php.ini && sed -i '/^session.serialize_handler.*/csession.serialize_handler = igbinary' /etc/php.ini 31 | 32 | FROM alpine 33 | LABEL maintainer="suconghou@gmail.com" 34 | COPY --from=build /usr/local/sbin/php-fpm /usr/local/sbin/php-fpm 35 | COPY --from=build /usr/local/bin/php /usr/local/bin/php 36 | COPY --from=build /usr/local/etc/php-fpm.conf /usr/local/etc/php-fpm.conf 37 | COPY --from=build /usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/ 38 | COPY --from=build /etc/php.ini /etc/php.ini 39 | COPY --from=build /etc/php.ini-development /etc/php.ini-development 40 | COPY --from=build /var/log/php-fpm /var/log/php-fpm 41 | EXPOSE 9000 42 | 43 | -------------------------------------------------------------------------------- /php/Dockerfile-redis: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make cmake wget file xz bison autoconf pcre-dev zlib-dev zlib-static libjpeg-turbo-dev libjpeg-turbo-static libpng-static libpng-dev bzip2-dev bzip2-static openssl-dev openssl-libs-static sqlite-dev sqlite-static oniguruma-dev libsodium-dev libsodium-static c-ares-dev c-ares-static linux-headers 4 | RUN LIBXML2_VERSION=libxml2-2.9.12 && wget http://xmlsoft.org/sources/${LIBXML2_VERSION}.tar.gz && tar zxf ${LIBXML2_VERSION}.tar.gz && cd ${LIBXML2_VERSION} && ./configure && make -j$(nproc) && make install 5 | RUN LIBXSLT_VERSION=libxslt-1.1.34 && wget http://xmlsoft.org/sources/${LIBXSLT_VERSION}.tar.gz && tar zxf ${LIBXSLT_VERSION}.tar.gz && cd ${LIBXSLT_VERSION} && ./configure && make -j$(nproc) && make install 6 | RUN CURL_VERSION=curl-8.15.0 && wget --no-check-certificate https://curl.haxx.se/download/${CURL_VERSION}.tar.xz && tar Jxf ${CURL_VERSION}.tar.xz && cd ${CURL_VERSION} && ./configure --with-openssl --enable-ares && make -j$(nproc) && make install 7 | RUN LIBFREETYPE_VERSION=freetype-2.13.3 && wget --no-check-certificate https://download-mirror.savannah.gnu.org/releases/freetype/${LIBFREETYPE_VERSION}.tar.gz && tar zxf ${LIBFREETYPE_VERSION}.tar.gz && cd ${LIBFREETYPE_VERSION} && ./configure && make -j$(nproc) && make install && ln -s $(pwd)/builds/unix/freetype-config /usr/local/bin/freetype-config 8 | RUN LIBZIP_VERSION=libzip-1.11.2 && wget --no-check-certificate https://libzip.org/download/${LIBZIP_VERSION}.tar.xz && tar Jxf ${LIBZIP_VERSION}.tar.xz && cd ${LIBZIP_VERSION} && mkdir build && cd build && cmake .. -DBUILD_SHARED_LIBS=OFF && make -j$(nproc) && make install 9 | RUN IMAGEMAGICK_VERSION=7.1.1-41 && wget -O- https://github.com/ImageMagick/ImageMagick/archive/${IMAGEMAGICK_VERSION}.tar.gz | tar xz && cd ImageMagick-${IMAGEMAGICK_VERSION} && ./configure --without-threads --without-fftw --without-perl --disable-opencl --without-modules --without-zip && make -j$(nproc) && make install 10 | RUN PHP_VERSION=php-8.3.13 && wget https://www.php.net/distributions/${PHP_VERSION}.tar.xz && tar xJf ${PHP_VERSION}.tar.xz && cd ${PHP_VERSION} 11 | RUN REDIS_VERSION=redis-6.1.0 && cd php-8.*.* && wget https://pecl.php.net/get/${REDIS_VERSION}.tgz && tar zxf ${REDIS_VERSION}.tgz && mv ${REDIS_VERSION} ext/php-redis 12 | RUN MSGPACK_VERSION=msgpack-3.0.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MSGPACK_VERSION}.tgz && tar zxf ${MSGPACK_VERSION}.tgz && mv ${MSGPACK_VERSION} ext/msgpack 13 | RUN IGBINARY_VERSION=igbinary-3.2.16 && cd php-8.*.* && wget https://pecl.php.net/get/${IGBINARY_VERSION}.tgz && tar zxf ${IGBINARY_VERSION}.tgz && mv ${IGBINARY_VERSION} ext/igbinary 14 | RUN IMAGICK_VERSION=imagick-3.7.0 && cd php-8.*.* && wget https://pecl.php.net/get/${IMAGICK_VERSION}.tgz && tar zxf ${IMAGICK_VERSION}.tgz && mv ${IMAGICK_VERSION} ext/imagick 15 | RUN APCU_VERSION=apcu-5.1.24 && cd php-8.*.* && wget https://pecl.php.net/get/${APCU_VERSION}.tgz && tar zxf ${APCU_VERSION}.tgz && mv ${APCU_VERSION} ext/apcu 16 | RUN cd php-8.*.* && rm -rf configure && ./buildconf --force && \ 17 | export CFLAGS="-O3" && LDFLAGS="-static" LIBS="$(curl-config --static-libs)" && \ 18 | export LIBZIP_LIBS="-L/usr/local/lib64 -lzip" && \ 19 | export LIBZIP_CFLAGS=-I/usr/local/include && \ 20 | ./configure --enable-inline-optimization --enable-static=yes --enable-shared=no --prefix=/usr/local --with-config-file-path=/etc --without-pear --disable-cgi --disable-opcache --enable-fpm --disable-phpdbg --enable-igbinary --with-msgpack --enable-redis --enable-redis-igbinary --enable-apcu --enable-pcntl --enable-sockets --enable-ftp --enable-bcmath --with-zip --with-zlib --enable-mbstring --with-imagick --enable-gd --with-freetype --with-jpeg --with-mysqli --with-pdo-mysql --with-openssl --enable-exif --enable-calendar --with-bz2 --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-shmop --with-xsl --with-sodium --with-curl=/usr/local/ && \ 21 | sed -i "s{-export-dynamic{-all-static{" Makefile && make -j$(nproc) && make install 22 | RUN cd php-8.*.* && mv /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf && mv /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf && mkdir -p /var/log/php-fpm && \ 23 | sed -i '/^;error_log.*/cerror_log = \/var\/log\/php-fpm\/php-fpm.log' /usr/local/etc/php-fpm.conf && \ 24 | sed -i '/^;pid.*/cpid = \/var\/run\/php-fpm.pid' /usr/local/etc/php-fpm.conf && \ 25 | sed -i '/^;slowlog.*/cslowlog = \/var\/log\/php-fpm\/$pool.log.slow' /usr/local/etc/php-fpm.d/www.conf && \ 26 | sed -i '/^;request_slowlog_timeout =.*/crequest_slowlog_timeout = 5' /usr/local/etc/php-fpm.d/www.conf && \ 27 | sed -i '/^;request_terminate_timeout =.*/crequest_terminate_timeout = 60' /usr/local/etc/php-fpm.d/www.conf && \ 28 | php-fpm -t && strip -s /usr/local/sbin/php-fpm && strip -s /usr/local/bin/php && mv php.ini-development /etc/ && mv php.ini-production /etc/php.ini && \ 29 | sed -i '/^expose_php.*/cexpose_php = Off' /etc/php.ini && sed -i '/^session.serialize_handler.*/csession.serialize_handler = igbinary' /etc/php.ini 30 | 31 | FROM alpine 32 | LABEL maintainer="suconghou@gmail.com" 33 | COPY --from=build /usr/local/sbin/php-fpm /usr/local/sbin/php-fpm 34 | COPY --from=build /usr/local/bin/php /usr/local/bin/php 35 | COPY --from=build /usr/local/etc/php-fpm.conf /usr/local/etc/php-fpm.conf 36 | COPY --from=build /usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/ 37 | COPY --from=build /etc/php.ini /etc/php.ini 38 | COPY --from=build /etc/php.ini-development /etc/php.ini-development 39 | COPY --from=build /var/log/php-fpm /var/log/php-fpm 40 | EXPOSE 9000 41 | 42 | -------------------------------------------------------------------------------- /php/Dockerfile-swoole: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make cmake wget file xz bison autoconf pcre-dev zlib-dev zlib-static libjpeg-turbo-dev libjpeg-turbo-static libpng-static libpng-dev bzip2-dev bzip2-static openssl-dev openssl-libs-static sqlite-dev sqlite-static oniguruma-dev libsodium-dev libsodium-static c-ares-dev c-ares-static linux-headers 4 | RUN LIBXML2_VERSION=libxml2-2.9.12 && wget http://xmlsoft.org/sources/${LIBXML2_VERSION}.tar.gz && tar zxf ${LIBXML2_VERSION}.tar.gz && cd ${LIBXML2_VERSION} && ./configure && make -j$(nproc) && make install 5 | RUN LIBXSLT_VERSION=libxslt-1.1.34 && wget http://xmlsoft.org/sources/${LIBXSLT_VERSION}.tar.gz && tar zxf ${LIBXSLT_VERSION}.tar.gz && cd ${LIBXSLT_VERSION} && ./configure && make -j$(nproc) && make install 6 | RUN CURL_VERSION=curl-8.15.0 && wget --no-check-certificate https://curl.haxx.se/download/${CURL_VERSION}.tar.xz && tar Jxf ${CURL_VERSION}.tar.xz && cd ${CURL_VERSION} && ./configure --with-openssl --enable-ares && make -j$(nproc) && make install 7 | RUN LIBFREETYPE_VERSION=freetype-2.13.3 && wget --no-check-certificate https://download-mirror.savannah.gnu.org/releases/freetype/${LIBFREETYPE_VERSION}.tar.gz && tar zxf ${LIBFREETYPE_VERSION}.tar.gz && cd ${LIBFREETYPE_VERSION} && ./configure && make -j$(nproc) && make install && ln -s $(pwd)/builds/unix/freetype-config /usr/local/bin/freetype-config 8 | RUN LIBZIP_VERSION=libzip-1.11.2 && wget --no-check-certificate https://libzip.org/download/${LIBZIP_VERSION}.tar.xz && tar Jxf ${LIBZIP_VERSION}.tar.xz && cd ${LIBZIP_VERSION} && mkdir build && cd build && cmake .. -DBUILD_SHARED_LIBS=OFF && make -j$(nproc) && make install 9 | RUN IMAGEMAGICK_VERSION=7.1.1-41 && wget -O- https://github.com/ImageMagick/ImageMagick/archive/${IMAGEMAGICK_VERSION}.tar.gz | tar xz && cd ImageMagick-${IMAGEMAGICK_VERSION} && ./configure --without-threads --without-fftw --without-perl --disable-opencl --without-modules --without-zip && make -j$(nproc) && make install 10 | RUN PHP_VERSION=php-8.3.13 && wget https://www.php.net/distributions/${PHP_VERSION}.tar.xz && tar xJf ${PHP_VERSION}.tar.xz && cd ${PHP_VERSION} 11 | RUN REDIS_VERSION=redis-6.1.0 && cd php-8.*.* && wget https://pecl.php.net/get/${REDIS_VERSION}.tgz && tar zxf ${REDIS_VERSION}.tgz && mv ${REDIS_VERSION} ext/php-redis 12 | RUN MSGPACK_VERSION=msgpack-3.0.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MSGPACK_VERSION}.tgz && tar zxf ${MSGPACK_VERSION}.tgz && mv ${MSGPACK_VERSION} ext/msgpack 13 | RUN IGBINARY_VERSION=igbinary-3.2.16 && cd php-8.*.* && wget https://pecl.php.net/get/${IGBINARY_VERSION}.tgz && tar zxf ${IGBINARY_VERSION}.tgz && mv ${IGBINARY_VERSION} ext/igbinary 14 | RUN IMAGICK_VERSION=imagick-3.7.0 && cd php-8.*.* && wget https://pecl.php.net/get/${IMAGICK_VERSION}.tgz && tar zxf ${IMAGICK_VERSION}.tgz && mv ${IMAGICK_VERSION} ext/imagick 15 | RUN APCU_VERSION=apcu-5.1.24 && cd php-8.*.* && wget https://pecl.php.net/get/${APCU_VERSION}.tgz && tar zxf ${APCU_VERSION}.tgz && mv ${APCU_VERSION} ext/apcu 16 | RUN MONGODB_VERSION=mongodb-1.20.0 && cd php-8.*.* && wget https://pecl.php.net/get/${MONGODB_VERSION}.tgz && tar zxf ${MONGODB_VERSION}.tgz && mv ${MONGODB_VERSION} ext/mongodb 17 | RUN SWOOLE_VERSION=swoole-5.1.5 && cd php-8.*.* && wget https://pecl.php.net/get/${SWOOLE_VERSION}.tgz && tar zxf ${SWOOLE_VERSION}.tgz && mv ${SWOOLE_VERSION} ext/swoole 18 | RUN cd php-8.*.* && rm -rf configure && ./buildconf --force && \ 19 | export CFLAGS="-O3" && LDFLAGS="-static" LIBS="$(curl-config --static-libs)" && \ 20 | export LIBZIP_LIBS="-L/usr/local/lib64 -lzip" && \ 21 | export LIBZIP_CFLAGS=-I/usr/local/include && \ 22 | ./configure --enable-inline-optimization --enable-static=yes --enable-shared=no --prefix=/usr/local --with-config-file-path=/etc --without-pear --disable-cgi --disable-opcache --disable-fpm --disable-phpdbg --enable-igbinary --with-msgpack --enable-redis --enable-redis-igbinary --enable-apcu --enable-pcntl --enable-sockets --enable-ftp --enable-bcmath --with-zip --with-zlib --enable-mbstring --with-imagick --enable-gd --with-freetype --with-jpeg --with-mysqli --with-pdo-mysql --enable-mysqlnd --with-openssl --enable-openssl --with-openssl-dir=/usr/ --enable-exif --enable-calendar --with-bz2 --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-shmop --with-xsl --with-sodium --with-curl=/usr/local/ --enable-cares --enable-mongodb && \ 23 | sed -i "s{-export-dynamic{-all-static{" Makefile && make -j$(nproc) && make install 24 | RUN cd php-8.*.* && \ 25 | strip -s /usr/local/bin/php && mv php.ini-production /etc/php.ini && \ 26 | sed -i '/^expose_php.*/cexpose_php = Off' /etc/php.ini && sed -i '/^session.serialize_handler.*/csession.serialize_handler = igbinary' /etc/php.ini 27 | 28 | FROM alpine 29 | LABEL maintainer="suconghou@gmail.com" 30 | COPY --from=build /usr/local/bin/php /usr/local/bin/php 31 | COPY --from=build /etc/php.ini /etc/php.ini 32 | EXPOSE 9000 33 | 34 | -------------------------------------------------------------------------------- /php/README.MD: -------------------------------------------------------------------------------- 1 | ## PHP 2 | 3 | static build php based on alpine 4 | 5 | ## Usage 6 | 7 | ``` 8 | docker run --rm -it suconghou/php sh 9 | ``` 10 | 11 | 12 | ## docker image 13 | 14 | https://hub.docker.com/r/suconghou/php/ 15 | 16 | ## dockerfile 17 | 18 | https://github.com/suconghou/docker/tree/master/php 19 | 20 | ## 8.0 & 8.1 & 8.2 & 8.3 21 | 22 | **官方静态编译** 23 | 24 | `latest` `8.1.x` 为8.1最新版,包含 cli,fpm,包含官方大部分扩展,静态编译 25 | 26 | `cli` 从`latest`版本挑出 cli 部分. 27 | 28 | `fpm` 从`latest`版本挑出 fpm 部分. 29 | 30 | **包含第三方库的静态编译** 31 | 32 | 33 | `redis` 此标签与`latest`类似,不同的是包含了 34 | 35 | - redis 36 | - igbinary 37 | - msgpack 38 | - imagick 39 | - apcu 40 | 41 | redis 扩展启用 igbinary 支持,静态编译 42 | 43 | 并且修改了 php.ini 的 session serialize_handler `session.serialize_handler=igbinary` 44 | 45 | 46 | `mongo` 标签与`redis`类似,在`redis`的基础上包含了mongodb 47 | 48 | `swoole` `swoole_5.x.x` 此标签与`mongo`类似,不同的是在其基础上包含了 49 | 50 | - swoole 51 | 52 | 此标签内不包含fpm 53 | 54 | 55 | ## 7.3 / 7.4 56 | 57 | > 7.3 / 7.4 已不再持续更新 58 | 59 | **官方静态编译** 60 | 61 | `7.3.x` `7.3` 为7.3最新版,包含 cli,fpm,包含官方大部分扩展,静态编译 62 | 63 | **包含第三方库的静态编译** 64 | 65 | 66 | `73_redis` 此标签与`latest`类似,不同的是包含了 67 | 68 | - redis 69 | - igbinary 70 | - msgpack 71 | - imagick 72 | - apcu 73 | 74 | redis 扩展启用 igbinary 支持,静态编译 75 | 76 | 并且修改了 php.ini 的 session serialize_handler `session.serialize_handler=igbinary` 77 | 78 | `73_swoole` `73_swoole_4.x.x` 此标签与`73_redis`类似,不同的是在其基础上包含了 79 | 80 | - swoole 81 | 82 | 此标签内不包含fpm 83 | 84 | 85 | 86 | ## 7.2 87 | 88 | 7.2 已不再持续更新 89 | 90 | **官方静态编译** 91 | 92 | `7.2.x` `7.2` 为 7.2 最新版,包含 cli,fpm,包含官方大部分扩展,静态编译 93 | 94 | **包含第三方库的静态编译** 95 | 96 | `72_redis` 此标签与`7.2`类似,不同的是包含了 97 | 98 | - redis 99 | - igbinary 100 | - msgpack 101 | - imagick 102 | 103 | redis 扩展启用 igbinary 支持,静态编译 104 | 105 | 并且修改了 php.ini 的 session serialize_handler `session.serialize_handler=igbinary` 106 | 107 | `72_swoole` `72_swoole_4.x.x` 此标签与`72_redis`类似,不同的是在其基础上包含了 108 | 109 | - swoole 110 | 111 | 此标签内不包含fpm 112 | 113 | 114 | ## 7.1 115 | 116 | `--with-mcrypt, --enable-gd-native-ttf` 这两个参数php7.2已经被废弃 117 | 118 | `7.1.x` 7.1 最新版,与 7.2`latest`版类似,包含 cli,fpm,包含官网大部分扩展,静态编译. 119 | 120 | 与 7.2 不同的是,含有`mcrypt`扩展,此扩展在 7.2 中已废除,7.2 推荐使用`openssl`扩展 121 | 122 | 7.1已不再维护 123 | 124 | 125 | 126 | 国内构建 可考虑替换alpine源 127 | 128 | ``` 129 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 130 | ``` -------------------------------------------------------------------------------- /php/make-redis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/php:redis -t=suconghou/php:8.3.7_redis . -f Dockerfile-redis 3 | -------------------------------------------------------------------------------- /php/make-swoole.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/php:swoole -t=suconghou/php:8.3.7_swoole_5.1.3 . -f Dockerfile-swoole 3 | -------------------------------------------------------------------------------- /php/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/php -t=suconghou/php:8.3.13 . && \ 3 | docker build -t=suconghou/php:cli . -f Dockerfile-cli && \ 4 | docker build -t=suconghou/php:fpm . -f Dockerfile-fpm 5 | -------------------------------------------------------------------------------- /polipo/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make curl 3 | RUN curl -sSL https://github.com/jech/polipo/archive/master.tar.gz | tar xz --strip 1 && ls -lha && \ 4 | sed -i '/^LOCAL_ROOT.*/cLOCAL_ROOT = \/' Makefile && \ 5 | sed -i '/^DISK_CACHE_ROOT*/cDISK_CACHE_ROOT = \/' Makefile 6 | RUN CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-Wl,--gc-sections -static" make -j2 && strip -s polipo 7 | 8 | FROM scratch 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /polipo /polipo 11 | ENTRYPOINT ["/polipo"] 12 | CMD ["diskCacheRoot=","localDocumentRoot=","proxyAddress=0.0.0.0","serverSlots=256","serverMaxSlots=256","objectHighMark=16384","chunkHighMark=50331648"] 13 | -------------------------------------------------------------------------------- /polipo/Dockerfile-proxy: -------------------------------------------------------------------------------- 1 | FROM suconghou/polipo AS p 2 | FROM suconghou/shadowsocks:local AS s 3 | FROM busybox 4 | LABEL maintainer="suconghou@gmail.com" 5 | COPY --from=p /polipo /usr/local/bin/polipo 6 | COPY --from=s /ss-local /usr/local/bin/ss-local 7 | ENV chunkHighMark 50331648 8 | ENV objectHighMark 16384 9 | ENV pmmFirstSize 163840 10 | ENV pmmSize 81920 11 | ENV proxyPort 8123 12 | ENV socksProxyType socks5 13 | ENV socksPort 7890 14 | ENV serverPort 7890 15 | ENV serverIP 0.0.0.0 16 | ENTRYPOINT ["/start.sh"] 17 | -------------------------------------------------------------------------------- /polipo/Dockerfile-v2: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make curl 3 | RUN curl -sSL https://github.com/ssb22/polipo2/archive/master.tar.gz | tar xz --strip 1 && ls -lha && \ 4 | sed -i '/^LOCAL_ROOT.*/cLOCAL_ROOT = \/' Makefile && \ 5 | sed -i '/^DISK_CACHE_ROOT*/cDISK_CACHE_ROOT = \/' Makefile 6 | RUN CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-Wl,--gc-sections -static" make -j2 && strip -s polipo2 7 | 8 | FROM scratch 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /polipo2 /polipo 11 | ENTRYPOINT ["/polipo"] 12 | CMD ["diskCacheRoot=","localDocumentRoot=","proxyAddress=0.0.0.0","serverSlots=256","serverMaxSlots=256","objectHighMark=16384","chunkHighMark=50331648"] 13 | -------------------------------------------------------------------------------- /polipo/README.MD: -------------------------------------------------------------------------------- 1 | ## polipo 2 | 3 | ``` 4 | docker run -d --name=polipo --restart always -m 100m --log-opt max-size=1m -p 18123:8123 suconghou/polipo proxyAddress=0.0.0.0 5 | ``` 6 | 7 | 8 | ``` 9 | proxyAddress = "127.0.0.1" 10 | proxyPort = 8123 11 | 12 | # if you've got plenty of memory 13 | chunkHighMark = 50331648 ## 最大允许使用的内存 14 | objectHighMark = 16384 15 | 16 | # disable the on-disk cache 17 | diskCacheRoot = "" 18 | 19 | pmmFirstSize = 163840 20 | pmmSize = 81920 21 | 22 | 23 | # socksParentProxy = "localhost:9050" 24 | # socksProxyType = socks5 25 | 26 | ``` 27 | -------------------------------------------------------------------------------- /polipo/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/polipo . 3 | -------------------------------------------------------------------------------- /polipo/makeproxy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/polipo:proxy . -f Dockerfile-proxy 3 | -------------------------------------------------------------------------------- /polipo/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | polipo chunkHighMark=$chunkHighMark objectHighMark=$objectHighMark pmmFirstSize=$pmmFirstSize pmmSize=$pmmSize proxyPort=$proxyPort socksParentProxy=0.0.0.0:$socksPort socksProxyType=$socksProxyType -------------------------------------------------------------------------------- /port/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make curl 3 | RUN curl -sSL https://github.com/rssnsj/portfwd/archive/master.tar.gz | tar xz --strip 1 && cd src && ls -lha && \ 4 | make CFLAGS="-Os" LDFLAGS="-static" && strip -s tcpfwd && strip -s udpfwd && mv tcpfwd udpfwd /usr/local/bin/ 5 | 6 | FROM busybox 7 | LABEL maintainer="suconghou@gmail.com" 8 | COPY --from=build /usr/local/bin/tcpfwd /usr/local/bin/tcpfwd 9 | COPY --from=build /usr/local/bin/udpfwd /usr/local/bin/udpfwd 10 | -------------------------------------------------------------------------------- /port/Dockerfile-portmapper: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ curl 3 | RUN curl -sSL https://github.com/wangyu-/tinyPortMapper/releases/download/20180224.0/tinymapper_binaries.tar.gz | tar xz && ls -lha && \ 4 | strip -s tinymapper_amd64 && mv tinymapper_amd64 /portmapper 5 | 6 | FROM scratch 7 | LABEL maintainer="suconghou@gmail.com" 8 | COPY --from=build /portmapper /portmapper 9 | ENTRYPOINT ["/portmapper"] 10 | -------------------------------------------------------------------------------- /port/Dockerfile-redir: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make curl 3 | RUN curl -sSL http://sammy.net/~sammy/hacks/redir-2.2.1.tar.gz | tar xz --strip 1 && ls -lha && \ 4 | make CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" && strip -s redir 5 | 6 | FROM scratch 7 | LABEL maintainer="suconghou@gmail.com" 8 | COPY --from=build /redir /redir 9 | ENTRYPOINT ["/redir"] 10 | -------------------------------------------------------------------------------- /port/Dockerfile-socat: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | ADD https://github.com/ernw/static-toolbox/raw/master/bin/linux/x86_64/socat / 3 | RUN chmod +x socat 4 | 5 | FROM scratch 6 | LABEL maintainer="suconghou@gmail.com" 7 | COPY --from=build /socat /socat 8 | ENTRYPOINT ["/socat"] 9 | -------------------------------------------------------------------------------- /port/Dockerfile-tcpfwd: -------------------------------------------------------------------------------- 1 | FROM suconghou/port AS build 2 | RUN ls /usr/local/bin/ 3 | 4 | FROM scratch 5 | LABEL maintainer="suconghou@gmail.com" 6 | COPY --from=build /usr/local/bin/tcpfwd /tcpfwd 7 | ENTRYPOINT ["/tcpfwd"] 8 | -------------------------------------------------------------------------------- /port/Dockerfile-udpfwd: -------------------------------------------------------------------------------- 1 | FROM suconghou/port AS build 2 | RUN ls /usr/local/bin/ 3 | 4 | FROM scratch 5 | LABEL maintainer="suconghou@gmail.com" 6 | COPY --from=build /usr/local/bin/udpfwd /udpfwd 7 | ENTRYPOINT ["/udpfwd"] 8 | -------------------------------------------------------------------------------- /port/README.MD: -------------------------------------------------------------------------------- 1 | 2 | 3 | portmapper 不支持域名形式的参数 4 | 5 | tcpfwd/udpfwd 支持域名形式参数 6 | 7 | socat 支持unix socket转换形式 8 | 9 | 10 | 示例:不修改docker配置, 将docker daemon的 unix socket 以端口的形式暴露出来 11 | ``` 12 | docker run --rm -p 2367:2367 -v /var/run/docker.sock:/docker.sock suconghou/port:socat TCP-LISTEN:2367,reuseaddr,fork UNIX-CLIENT:/docker.sock 13 | ``` 14 | 15 | 后台运行12367端口 16 | ``` 17 | 18 | docker run -d \ 19 | -p 12367:12367 \ 20 | -v /var/run/docker.sock:/docker.sock \ 21 | -m 20m \ 22 | --restart always \ 23 | suconghou/port:socat TCP-LISTEN:12367,reuseaddr,fork UNIX-CLIENT:/docker.sock 24 | ``` 25 | 26 | 27 | 28 | socat 文件来源于 https://github.com/ernw/static-toolbox , 其工程还提供 ncat , nmap, nping 等静态编译后的可执行文件 29 | 30 | https://github.com/andrew-d/static-binaries/tree/master/binaries/linux/x86_64 旧版本静态编译 socat 仅300KB+ 31 | 32 | redir 仅支持TCP 33 | 34 | teeproxy 35 | 36 | https://github.com/kklis/proxy 37 | 38 | 39 | `proxy -l 9077 -h 61.135.169.125 -p 80 -f -i "tee /dev/stderr " -o "tee /dev/stderr"` 40 | 41 | 42 | ## rinetd 43 | 44 | https://github.com/samhocevar/rinetd 45 | 46 | rinetd并没有使用epoll,而是用了select,高负载下将消耗较多CPU。 47 | 48 | ## docker images 49 | 50 | https://hub.docker.com/r/suconghou/port/ 51 | 52 | ## dockerfile 53 | 54 | https://github.com/suconghou/docker/tree/master/port 55 | -------------------------------------------------------------------------------- /port/make-portmapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/port:portmapper . -f Dockerfile-portmapper 3 | -------------------------------------------------------------------------------- /port/make-redir.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/port:redir . -f Dockerfile-redir 3 | -------------------------------------------------------------------------------- /port/make-socat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/port:socat . -f Dockerfile-socat 3 | -------------------------------------------------------------------------------- /port/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/port . && \ 3 | docker build -t=suconghou/port:tcpfwd . -f Dockerfile-tcpfwd && \ 4 | docker build -t=suconghou/port:udpfwd . -f Dockerfile-udpfwd 5 | -------------------------------------------------------------------------------- /privoxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make autoconf pcre-dev zlib-dev zlib-static 3 | RUN wget -O- https://www.privoxy.org/sf-download-mirror/Sources/3.0.28%20%28stable%29/privoxy-3.0.28-stable-src.tar.gz | tar xz --strip 1 && \ 4 | CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-Wl,--gc-sections -static" autoheader && autoconf && ./configure && \ 5 | make CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-Wl,--gc-sections -static" && \ 6 | strip -s privoxy 7 | 8 | FROM busybox 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /privoxy /usr/local/bin/privoxy 11 | -------------------------------------------------------------------------------- /privoxy/README.MD: -------------------------------------------------------------------------------- 1 | ## privoxy 2 | 3 | static build privoxy 4 | 5 | version 3.0.26 6 | 7 | 8 | 9 | ## Dockerfile 10 | 11 | https://github.com/suconghou/docker/tree/master/privoxy 12 | 13 | docker image https://hub.docker.com/r/suconghou/privoxy/ 14 | 15 | 16 | -------------------------------------------------------------------------------- /privoxy/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/privoxy . 3 | -------------------------------------------------------------------------------- /puppeteer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM suconghou/node:yarn 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --no-cache chromium 4 | 5 | -------------------------------------------------------------------------------- /puppeteer/Dockerfile-cn: -------------------------------------------------------------------------------- 1 | FROM suconghou/puppeteer:202509 2 | RUN apk add --no-cache nss freetype freetype-dev harfbuzz ca-certificates ttf-freefont 3 | RUN cd /usr/share/fonts/ && \ 4 | wget https://github.com/gnuletik/puppeteer-heroku-buildpack-fonts/raw/main/fonts/wqy-zenhei.ttc && \ 5 | wget https://github.com/gnuletik/puppeteer-heroku-buildpack-fonts/raw/main/fonts/wqy-microhei.ttc && \ 6 | wget https://github.com/joypixels/emojione-assets/releases/download/4.5/emojione-android.ttf && \ 7 | fc-cache -f /usr/share/fonts/ 8 | RUN cd /usr/share/fonts/ && \ 9 | wget https://github.com/refinec/PingFangSC/raw/main/ttf/PingFangSC-Light.ttf && \ 10 | wget https://github.com/refinec/PingFangSC/raw/main/ttf/PingFangSC-Medium.ttf && \ 11 | wget https://github.com/refinec/PingFangSC/raw/main/ttf/PingFangSC-Regular.ttf && \ 12 | wget https://github.com/refinec/PingFangSC/raw/main/ttf/PingFangSC-Semibold.ttf && \ 13 | wget https://github.com/refinec/PingFangSC/raw/main/ttf/PingFangSC-Thin.ttf && \ 14 | wget https://github.com/refinec/PingFangSC/raw/main/ttf/PingFangSC-Ultralight.ttf && \ 15 | fc-cache -f /usr/share/fonts/ 16 | -------------------------------------------------------------------------------- /puppeteer/README.MD: -------------------------------------------------------------------------------- 1 | ## puppeteer docker 2 | 3 | puppeteer as a service 4 | 5 | 6 | ## Chromium 7 | 8 | Chromium 持续更新地址 9 | 10 | https://download-chromium.appspot.com/ 11 | 12 | 13 | 每个构建版本信息 14 | 15 | https://omahaproxy.appspot.com/ 16 | 17 | ## 中文支持 18 | 19 | 默认安装的`Chromium` 不支持中文 20 | 21 | https://www.google.com/get/noto/help/cjk/ 22 | 23 | https://github.com/googlei18n/noto-cjk 24 | 25 | 26 | 文件 27 | 28 | ``` 29 | https://github.com/CoffeeAndCode/puppeteer-heroku-buildpack/raw/master/fonts/wqy-zenhei.ttc 30 | https://github.com/CoffeeAndCode/puppeteer-heroku-buildpack/raw/master/fonts/wqy-microhei.ttc 31 | `` 32 | 添加对 中文,日文,韩文的支持 33 | 34 | https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-on-heroku 35 | 36 | 37 | 文件 38 | `https://github.com/emojione/emojione-assets/releases/download/3.1.2/emojione-android.ttf` 39 | 添加对emjio的支持 40 | 41 | 42 | ``` 43 | RUN cd /usr/share/fonts && \ 44 | wget https://noto-website-2.storage.googleapis.com/pkgs/NotoSerifSC.zip && unzip NotoSerifSC.zip && rm -rf NotoSerifSC.zip *.txt README && \ 45 | wget https://noto-website-2.storage.googleapis.com/pkgs/NotoSansSC.zip && unzip NotoSansSC.zip && rm -rf NotoSansSC.zip *.txt README && \ 46 | wget https://github.com/emojione/emojione-assets/releases/download/3.1.2/emojione-android.ttf 47 | ``` -------------------------------------------------------------------------------- /puppeteer/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/puppeteer:202509 . 3 | 4 | -------------------------------------------------------------------------------- /python/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 AS build 2 | RUN yum -y groupinstall "Development tools" 3 | RUN yum -y install gcc gcc-c++ wget zlib zlib-devel libffi libffi-devel readline-devel bzip2-devel tk-devel sqlite-devel xz-devel gdbm-devel db4-devel 4 | RUN wget --no-check-certificate -O- https://www.openssl.org/source/openssl-1.1.1t.tar.gz | tar xz && cd openssl-1.1.1t && \ 5 | ./config --prefix=/usr/local/openssl-1.1.1 && make -j4 && make install 6 | RUN wget --no-check-certificate -O- https://www.python.org/ftp/python/3.10.10/Python-3.10.10.tar.xz | tar xJ && \ 7 | cd Python-3.10.10 && ls -lha 8 | RUN LDFLAGS="${LDFLAGS} -Wl,-rpath=/usr/local/openssl-1.1.1/lib" ./configure --prefix=/opt/python3 --enable-optimizations --with-lto --disable-shared --with-openssl=/usr/local/openssl-1.1.1 && \ 9 | make -j4 10 | 11 | 12 | -------------------------------------------------------------------------------- /python/Makefile: -------------------------------------------------------------------------------- 1 | simd: 2 | docker build -t=suconghou/python:pillow-simd . -f pillow-simd 3 | 4 | simd_sse: 5 | docker build -t=suconghou/python:pillow-simd-sse . -f pillow-simd-sse 6 | -------------------------------------------------------------------------------- /python/README.MD: -------------------------------------------------------------------------------- 1 | 2 | Python2.7.5是CentOS 7默认安装的版本; 3 | Python3.6.8是CentOS 7中可以通过默认repo安装到的最新版本; 4 | 5 | 6 | ## pillow-simd 7 | 8 | `make simd` 9 | 10 | 11 | ``` 12 | FROM python:alpine 13 | RUN apk add --no-cache gcc g++ make zlib-dev libjpeg-turbo-dev libwebp-dev freetype-dev && \ 14 | CC="cc -mavx2" pip3 install -U --force-reinstall pillow-simd && \ 15 | pip3 install qrcode 16 | ``` 17 | 18 | python 3.8.5 with 19 | 20 | `pillow-simd-7.0.0.post3 qrcode-6.1 six-1.15.0` -------------------------------------------------------------------------------- /python/pillow-simd: -------------------------------------------------------------------------------- 1 | FROM python:3.12-alpine 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --no-cache gcc g++ make zlib-dev libjpeg-turbo-dev libwebp-dev freetype-dev 4 | RUN CC="cc -mavx2" pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple pillow-simd qrcode 5 | 6 | -------------------------------------------------------------------------------- /python/pillow-simd-sse: -------------------------------------------------------------------------------- 1 | FROM python:3.12-alpine 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --no-cache gcc g++ make zlib-dev libjpeg-turbo-dev libwebp-dev freetype-dev 4 | RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple pillow-simd qrcode 5 | 6 | -------------------------------------------------------------------------------- /redis/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make wget linux-headers 4 | RUN REDIS_VERSION=redis-7.4.2 && wget http://download.redis.io/releases/${REDIS_VERSION}.tar.gz && tar xzf ${REDIS_VERSION}.tar.gz && cd ${REDIS_VERSION} && \ 5 | make LDFLAGS=-static -j2 && make install && strip -s /usr/local/bin/* && mv redis.conf /etc/redis.conf 6 | 7 | FROM alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /usr/local/bin/ /usr/local/bin/ 10 | COPY --from=build /etc/redis.conf /etc/redis.conf 11 | EXPOSE 6379 12 | -------------------------------------------------------------------------------- /redis/Dockerfile-arm32v7: -------------------------------------------------------------------------------- 1 | FROM arm32v7/alpine AS build 2 | RUN apk add --update gcc g++ make wget linux-headers 3 | RUN REDIS_VERSION=redis-7.4.2 && wget http://download.redis.io/releases/${REDIS_VERSION}.tar.gz && tar xzf ${REDIS_VERSION}.tar.gz && cd ${REDIS_VERSION} && \ 4 | make LDFLAGS=-static -j2 && make install && strip -s /usr/local/bin/* && mv redis.conf /etc/redis.conf 5 | 6 | FROM arm32v7/alpine 7 | LABEL maintainer="suconghou@gmail.com" 8 | COPY --from=build /usr/local/bin/ /usr/local/bin/ 9 | COPY --from=build /etc/redis.conf /etc/redis.conf 10 | EXPOSE 6379 11 | -------------------------------------------------------------------------------- /redis/Dockerfile-arm64v8: -------------------------------------------------------------------------------- 1 | FROM arm64v8/alpine AS build 2 | RUN apk add --update gcc g++ make wget linux-headers 3 | RUN REDIS_VERSION=redis-7.4.2 && wget http://download.redis.io/releases/${REDIS_VERSION}.tar.gz && tar xzf ${REDIS_VERSION}.tar.gz && cd ${REDIS_VERSION} && \ 4 | make LDFLAGS=-static -j2 && make install && strip -s /usr/local/bin/* && mv redis.conf /etc/redis.conf 5 | 6 | FROM arm64v8/alpine 7 | LABEL maintainer="suconghou@gmail.com" 8 | COPY --from=build /usr/local/bin/ /usr/local/bin/ 9 | COPY --from=build /etc/redis.conf /etc/redis.conf 10 | EXPOSE 6379 11 | -------------------------------------------------------------------------------- /redis/Dockerfile-busybox: -------------------------------------------------------------------------------- 1 | FROM suconghou/redis AS build 2 | RUN /usr/local/bin/redis-server -v 3 | 4 | FROM busybox 5 | LABEL maintainer="suconghou@gmail.com" 6 | COPY --from=build /usr/local/bin/ /usr/local/bin/ 7 | COPY --from=build /etc/redis.conf /etc/redis.conf 8 | EXPOSE 6379 9 | -------------------------------------------------------------------------------- /redis/README.MD: -------------------------------------------------------------------------------- 1 | ## redis 2 | 3 | redis docker image 4 | 5 | redis version 7.4.2 6 | 7 | website http://redis.io/ 8 | 9 | all redis version release here http://download.redis.io/releases/ 10 | 11 | 12 | ``` 13 | docker run -d suconghou/redis redis-server 14 | ``` 15 | 16 | 17 | ## dockerfile 18 | 19 | https://github.com/suconghou/docker/tree/master/redis 20 | 21 | 22 | docker image https://hub.docker.com/r/suconghou/redis/ 23 | 24 | ## quick start 25 | 26 | just for development `docker run --rm -it -p 6379:6379 suconghou/redis redis-server --protected-mode no` 27 | 28 | 29 | `redis-server --daemonize yes` 30 | or 31 | `redis-server --protected-mode no --daemonize yes` 32 | 33 | with password auth 34 | 35 | `redis-server --protected-mode no --daemonize yes --requirepass QAZwsx123edcvfr654JKL` 36 | 37 | docker volume create redis-data 38 | 39 | docker network create --driver overlay --attachable srv 40 | 41 | ``` 42 | docker run -d \ 43 | --name redis \ 44 | --restart always \ 45 | -m 100m \ 46 | --network srv \ 47 | -v redis-data:/data \ 48 | -e TZ="CST-8" \ 49 | --sysctl net.core.somaxconn=1024 \ 50 | -p 0.0.0.0:16379:6379 \ 51 | suconghou/redis:4.0.11 \ 52 | redis-server /etc/redis.conf --requirepass password --dir /data 53 | 54 | ``` -------------------------------------------------------------------------------- /redis/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/redis -t=suconghou/redis:7.4.2 -t=suconghou/redis:alpine . && \ 3 | docker build -t=suconghou/redis:busybox . -f Dockerfile-busybox 4 | -------------------------------------------------------------------------------- /server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM suconghou/sshd AS sshd 2 | FROM suconghou/nginx AS nginx 3 | FROM suconghou/php AS php 4 | 5 | 6 | FROM alpine 7 | LABEL maintainer="suconghou@gmail.com" 8 | COPY --from=sshd /usr/local/bin/ssh-keygen /usr/local/bin/ssh-keygen 9 | COPY --from=sshd /usr/local/sbin/sshd /usr/local/sbin/sshd 10 | COPY --from=nginx /usr/local/sbin/nginx /usr/local/sbin/nginx 11 | COPY --from=nginx /etc/nginx /etc/nginx 12 | COPY --from=php /usr/local/bin/php /usr/local/bin/php 13 | COPY --from=php /usr/local/sbin/php-fpm /usr/local/sbin/php-fpm 14 | COPY --from=php /usr/local/etc/php-fpm.conf /usr/local/etc/php-fpm.conf 15 | COPY --from=php /usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/ 16 | COPY --from=php /etc/php.ini /etc/php.ini 17 | 18 | RUN mkdir -p /usr/local/etc/ /var/log/php-fpm /var/log/nginx && \ 19 | ln -sf /dev/stdout /var/log/nginx/access.log && \ 20 | ln -sf /dev/stderr /var/log/nginx/error.log && \ 21 | echo 'PermitRootLogin yes' > /usr/local/etc/sshd_config && \ 22 | ssh-keygen -t dsa -f /usr/local/etc/ssh_host_dsa_key -N '' && \ 23 | ssh-keygen -t rsa -f /usr/local/etc/ssh_host_rsa_key -N '' && \ 24 | ssh-keygen -t ecdsa -f /usr/local/etc/ssh_host_ecdsa_key -N '' && \ 25 | ssh-keygen -t ed25519 -f /usr/local/etc/ssh_host_ed25519_key -N '' && \ 26 | echo "root:sch@dockerssh" | chpasswd && \ 27 | sed -i '/^;session.save_path.*/csession.save_path = "/dev/shm"' /etc/php.ini 28 | COPY nginx.conf /etc/nginx/nginx.conf 29 | CMD ["sh","-c","/usr/local/sbin/sshd && php-fpm && nginx -g 'daemon off;'"] 30 | EXPOSE 22 80 31 | -------------------------------------------------------------------------------- /server/README.MD: -------------------------------------------------------------------------------- 1 | ## Server 2 | 3 | include `nginx`,`php-fpm`, and `sshd` 4 | 5 | 6 | `docker run -d --name dev --restart always -m 100m --log-opt max-size=2m -v /data/share/runtime/:/www -p 18001:80 -p 12201:22 suconghou/server:dev` 7 | 8 | 9 | 可以使用`/data/share/runtime/:/www:ro`使用只读 10 | 11 | 12 | ``` 13 | worker_processes 1; 14 | events { 15 | worker_connections 1024; 16 | } 17 | http { 18 | include mime.types; 19 | default_type application/octet-stream; 20 | sendfile on; 21 | tcp_nopush on; 22 | gzip on; 23 | ssi on; 24 | keepalive_timeout 65; 25 | fastcgi_connect_timeout 60s; 26 | fastcgi_send_timeout 60s; 27 | fastcgi_read_timeout 60s; 28 | client_max_body_size 50m; 29 | server { 30 | listen 80; 31 | server_name 0.0.0.0; 32 | index index.html index.php; 33 | if ($host ~* ^(([\w\-]+)\.share\.ourwill\.cn)$) { 34 | set $subdomain $2; 35 | } 36 | root /www/$subdomain; 37 | if ( !-d $document_root ){ 38 | return 404; 39 | } 40 | location / { 41 | try_files $uri $uri/ /index.php$is_args$args; 42 | } 43 | location ~ [^/]\.php(/|$) { 44 | try_files $uri =404; 45 | fastcgi_pass 127.0.0.1:9000; 46 | fastcgi_param debug 2; 47 | include fastcgi.conf; 48 | } 49 | } 50 | } 51 | ``` 52 | 53 | 54 | ## service 55 | 56 | mysql redis memcached sshd 185.1MB 57 | 58 | `docker build -t=suconghou/server:service -f service .` 59 | 60 | start the service 61 | 62 | ``` 63 | docker run -d --name service --restart always -m 360m --log-opt max-size=2m -v service-data:/var/lib/mysql -p 2222:22 -p 443:443 -p 3306:3306 -p 6379:6379 -p 11211:11211 suconghou/server:service 64 | ``` 65 | 66 | ``` 67 | docker run -d --name service --restart always -m 360m --log-opt max-size=2m -p 2222:22 -p 1443:443 -p 3306:3306 -p 6379:6379 -p 11211:11211 suconghou/server:service 68 | ``` 69 | 70 | you can login from ssh use user `root` password `123456` 71 | 72 | and mysql root password is 123456 73 | 74 | 75 | 76 | ``` 77 | use mysql; 78 | UPDATE user SET password=PASSWORD("123456") WHERE user='root'; 79 | FLUSH PRIVILEGES; 80 | ``` 81 | 82 | memcached/redis/sshd/ 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /server/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/server:dev . 3 | 4 | -------------------------------------------------------------------------------- /server/nginx.conf: -------------------------------------------------------------------------------- 1 | worker_processes 1; 2 | events { 3 | worker_connections 1024; 4 | } 5 | http { 6 | include mime.types; 7 | default_type application/octet-stream; 8 | sendfile on; 9 | tcp_nopush on; 10 | gzip on; 11 | ssi on; 12 | keepalive_timeout 65; 13 | fastcgi_connect_timeout 60s; 14 | fastcgi_send_timeout 60s; 15 | fastcgi_read_timeout 60s; 16 | client_max_body_size 50m; 17 | server { 18 | listen 80; 19 | server_name 0.0.0.0; 20 | index index.html index.php; 21 | if ($host ~* ^(([\w\-]+)\.share\.ourwill\.cn)$) { 22 | set $subdomain $2; 23 | } 24 | root /www/$subdomain; 25 | if ( !-d $document_root ){ 26 | return 404; 27 | } 28 | location / { 29 | try_files $uri $uri/ /index.php$is_args$args; 30 | } 31 | location ~ [^/]\.php(/|$) { 32 | try_files $uri =404; 33 | fastcgi_pass 127.0.0.1:9000; 34 | fastcgi_param run_args dev.2; 35 | include fastcgi.conf; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /shadowsocks/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine as build 2 | RUN apk add --update binutils 3 | RUN wget -O- https://github.com/shadowsocks/shadowsocks-rust/releases/download/v1.11.2/shadowsocks-v1.11.2.x86_64-unknown-linux-musl.tar.xz | tar Jx && \ 4 | strip -s sslocal ssserver 5 | FROM alpine 6 | LABEL maintainer="suconghou@gmail.com" 7 | COPY --from=build sslocal ssserver /usr/local/bin/ 8 | ENTRYPOINT ["/usr/local/bin/ssserver"] 9 | 10 | -------------------------------------------------------------------------------- /shadowsocks/Dockerfile-arm32v7: -------------------------------------------------------------------------------- 1 | FROM arm32v7/alpine AS build 2 | RUN apk add --update gcc g++ make file curl autoconf linux-headers libev-dev libtool c-ares-dev pcre-dev python2 3 | RUN LIBSODIUM_VER=1.0.16 && curl -sSL https://download.libsodium.org/libsodium/releases/libsodium-$LIBSODIUM_VER.tar.gz | tar xz && cd libsodium-${LIBSODIUM_VER} && ls -lha && ./configure --prefix=/usr && make -j2 && make install 4 | RUN MBEDTLS_VER=2.14.1 && curl -sSL https://tls.mbed.org/download/mbedtls-$MBEDTLS_VER-gpl.tgz | tar xz && cd mbedtls-$MBEDTLS_VER && ls -lha && make SHARED=1 CFLAGS=-fPIC && make DESTDIR=/usr install 5 | RUN SS_VER=3.3.5 && curl -sSL https://github.com/shadowsocks/shadowsocks-libev/releases/download/v${SS_VER}/shadowsocks-libev-${SS_VER}.tar.gz | tar xz --strip 1 && \ 6 | CFLAGS=-Os && ./configure --prefix=/usr/local --enable-static --disable-documentation && \ 7 | sed -i "s/LDFLAGS = /LDFLAGS = -all-static/g" ./src/Makefile && sed -i "s/LDFLAGS = /LDFLAGS = -all-static/g" ./Makefile && make -j2 && make install && \ 8 | strip -s /usr/local/bin/ss-server /usr/local/bin/ss-local /usr/local/bin/ss-tunnel /usr/local/bin/ss-redir /usr/local/bin/ss-manager 9 | 10 | FROM arm32v7/alpine 11 | LABEL maintainer="suconghou@gmail.com" 12 | COPY --from=build /usr/local/bin/ss-server /usr/local/bin/ss-server 13 | COPY --from=build /usr/local/bin/ss-local /usr/local/bin/ss-local 14 | COPY --from=build /usr/local/bin/ss-tunnel /usr/local/bin/ss-tunnel 15 | COPY --from=build /usr/local/bin/ss-redir /usr/local/bin/ss-redir 16 | COPY --from=build /usr/local/bin/ss-manager /usr/local/bin/ss-manager 17 | 18 | 19 | -------------------------------------------------------------------------------- /shadowsocks/Dockerfile-arm64v8: -------------------------------------------------------------------------------- 1 | FROM arm64v8/alpine AS build 2 | RUN apk add --update gcc g++ make file curl autoconf linux-headers libev-dev libtool c-ares-dev pcre-dev python2 3 | RUN LIBSODIUM_VER=1.0.16 && curl -sSL https://download.libsodium.org/libsodium/releases/libsodium-$LIBSODIUM_VER.tar.gz | tar xz && cd libsodium-${LIBSODIUM_VER} && ls -lha && ./configure --prefix=/usr && make -j2 && make install 4 | RUN MBEDTLS_VER=2.14.1 && curl -sSL https://tls.mbed.org/download/mbedtls-$MBEDTLS_VER-gpl.tgz | tar xz && cd mbedtls-$MBEDTLS_VER && ls -lha && make SHARED=1 CFLAGS=-fPIC && make DESTDIR=/usr install 5 | RUN SS_VER=3.3.5 && curl -sSL https://github.com/shadowsocks/shadowsocks-libev/releases/download/v${SS_VER}/shadowsocks-libev-${SS_VER}.tar.gz | tar xz --strip 1 && \ 6 | CFLAGS=-Os && ./configure --prefix=/usr/local --enable-static --disable-documentation && \ 7 | sed -i "s/LDFLAGS = /LDFLAGS = -all-static/g" ./src/Makefile && sed -i "s/LDFLAGS = /LDFLAGS = -all-static/g" ./Makefile && make -j2 && make install && \ 8 | strip -s /usr/local/bin/ss-server /usr/local/bin/ss-local /usr/local/bin/ss-tunnel /usr/local/bin/ss-redir /usr/local/bin/ss-manager 9 | 10 | FROM arm64v8/alpine 11 | LABEL maintainer="suconghou@gmail.com" 12 | COPY --from=build /usr/local/bin/ss-server /usr/local/bin/ss-server 13 | COPY --from=build /usr/local/bin/ss-local /usr/local/bin/ss-local 14 | COPY --from=build /usr/local/bin/ss-tunnel /usr/local/bin/ss-tunnel 15 | COPY --from=build /usr/local/bin/ss-redir /usr/local/bin/ss-redir 16 | COPY --from=build /usr/local/bin/ss-manager /usr/local/bin/ss-manager 17 | 18 | 19 | -------------------------------------------------------------------------------- /shadowsocks/Dockerfile-libev: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add --update gcc g++ make file curl autoconf linux-headers libev-dev libtool c-ares-dev c-ares-static pcre-dev python2 4 | RUN LIBSODIUM_VER=1.0.18 && curl -sSL https://download.libsodium.org/libsodium/releases/libsodium-$LIBSODIUM_VER.tar.gz | tar xz && cd libsodium-${LIBSODIUM_VER} && ls -lha && ./configure --prefix=/usr && make -j2 && make install 5 | RUN MBEDTLS_VER=2.16.6 && curl -sSL https://tls.mbed.org/download/mbedtls-$MBEDTLS_VER-gpl.tgz | tar xz && cd mbedtls-$MBEDTLS_VER && ls -lha && make SHARED=1 CFLAGS=-fPIC && make -j4 DESTDIR=/usr install 6 | RUN SS_VER=3.3.5 && curl -sSL https://github.com/shadowsocks/shadowsocks-libev/releases/download/v${SS_VER}/shadowsocks-libev-${SS_VER}.tar.gz | tar xz --strip 1 && \ 7 | CFLAGS=-Os && ./configure --prefix=/usr/local --enable-static --disable-documentation && \ 8 | sed -i "s/LDFLAGS = /LDFLAGS = -all-static/g" ./src/Makefile && sed -i "s/LDFLAGS = /LDFLAGS = -all-static/g" ./Makefile && make -j2 && make install && \ 9 | strip -s /usr/local/bin/ss-server /usr/local/bin/ss-local /usr/local/bin/ss-tunnel /usr/local/bin/ss-redir /usr/local/bin/ss-manager 10 | 11 | FROM busybox 12 | LABEL maintainer="suconghou@gmail.com" 13 | COPY --from=build /usr/local/bin/ss-server /usr/local/bin/ss-server 14 | COPY --from=build /usr/local/bin/ss-local /usr/local/bin/ss-local 15 | COPY --from=build /usr/local/bin/ss-tunnel /usr/local/bin/ss-tunnel 16 | COPY --from=build /usr/local/bin/ss-redir /usr/local/bin/ss-redir 17 | COPY --from=build /usr/local/bin/ss-manager /usr/local/bin/ss-manager 18 | 19 | 20 | -------------------------------------------------------------------------------- /shadowsocks/Dockerfile-local: -------------------------------------------------------------------------------- 1 | FROM suconghou/shadowsocks:libev AS build 2 | RUN ls -lh /usr/local/bin/ss-local 3 | FROM scratch 4 | LABEL maintainer="suconghou@gmail.com" 5 | COPY --from=build /usr/local/bin/ss-local / 6 | ENTRYPOINT ["/ss-local"] 7 | EXPOSE 443 8 | -------------------------------------------------------------------------------- /shadowsocks/Dockerfile-server: -------------------------------------------------------------------------------- 1 | FROM suconghou/shadowsocks:libev AS build 2 | RUN ls -lh /usr/local/bin/ss-server 3 | FROM scratch 4 | LABEL maintainer="suconghou@gmail.com" 5 | COPY --from=build /usr/local/bin/ss-server / 6 | ENTRYPOINT ["/ss-server"] 7 | EXPOSE 443 8 | -------------------------------------------------------------------------------- /shadowsocks/README.MD: -------------------------------------------------------------------------------- 1 | ## Shadowsocks docker 2 | 3 | 4 | shadowsocks-rust version 1.8.9 5 | 6 | shadowsocks-libev version 3.3.5 7 | 8 | ## Usage 9 | 10 | **shadowsocks-rust** 11 | 12 | start docker 13 | ``` 14 | docker run --name shadowsocks -d -p 443:8388 suconghou/shadowsocks -k 123456 -s "[::]:8388" -m aes-256-gcm 15 | ``` 16 | 17 | 18 | **shadowsocks-libev** 19 | 20 | 21 | ``` 22 | docker run --name shadowsocks -d -p 443:443 suconghou/shadowsocks:server -s 0.0.0.0 -p 443 -k 123456 -m chacha20-ietf-poly1305 -t 300 -d 8.8.8.8 --fast-open -u 23 | ``` 24 | 25 | `-v` show the version 26 | 27 | and encryption method is `chacha20-ietf-poly1305` 28 | 29 | ## Dockerfile 30 | 31 | https://github.com/suconghou/docker/tree/master/shadowsocks 32 | 33 | docker images 34 | 35 | https://hub.docker.com/r/suconghou/shadowsocks/ 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /shadowsocks/make-libev.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/shadowsocks:libev -t=suconghou/shadowsocks:3.3.5 . -f Dockerfile-libev && \ 3 | docker build -t=suconghou/shadowsocks:server . -f Dockerfile-server && \ 4 | docker build -t=suconghou/shadowsocks:local . -f Dockerfile-local 5 | -------------------------------------------------------------------------------- /shadowsocks/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/shadowsocks . 3 | -------------------------------------------------------------------------------- /sniproxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories 3 | RUN apk add libressl autoconf automake build-base gettext-dev libev-dev pcre-dev udns-dev bsd-compat-headers 4 | RUN wget -O- http://www.corpit.ru/mjt/udns/udns-0.5.tar.gz | tar xz && \ 5 | cd udns-0.5 && ./configure && make staticlib && mv libudns.a /usr/lib/ 6 | RUN wget -O- https://github.com/dlundquist/sniproxy/archive/0.6.1.tar.gz | tar xz --strip 1 && \ 7 | export CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-Wl,--gc-sections -static" && ./autogen.sh && \ 8 | ./configure && make -j2 && mv src/sniproxy / && cd / && \ 9 | strip -s sniproxy && ./sniproxy -V 10 | 11 | FROM busybox 12 | LABEL maintainer="suconghou@gmail.com" 13 | COPY --from=build /sniproxy /usr/local/bin/sniproxy 14 | COPY sniproxy.conf /etc/ 15 | CMD [ "sniproxy","-c","/etc/sniproxy.conf","-f"] -------------------------------------------------------------------------------- /sniproxy/README.MD: -------------------------------------------------------------------------------- 1 | ## sniproxy 2 | 3 | static build sniproxy 4 | 5 | version 0.6.1 6 | 7 | 8 | ``` 9 | sniproxy -c /etc/sniproxy.conf -f 10 | ``` 11 | 12 | ``` 13 | docker run --privileged \ 14 | -d \ 15 | --log-opt max-size=1m \ 16 | --name sni \ 17 | --restart always \ 18 | -p 0.0.0.0:443:443 \ 19 | -m 100m \ 20 | suconghou/sniproxy 21 | ``` 22 | 23 | 24 | ## Dockerfile 25 | 26 | https://github.com/suconghou/docker/tree/master/sniproxy 27 | 28 | docker image https://hub.docker.com/r/suconghou/sniproxy/ 29 | 30 | 31 | -------------------------------------------------------------------------------- /sniproxy/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/sniproxy -t=suconghou/sniproxy:0.6.1 . 3 | -------------------------------------------------------------------------------- /sniproxy/sniproxy.conf: -------------------------------------------------------------------------------- 1 | user root 2 | pidfile /var/sniproxy.pid 3 | resolver { 4 | nameserver 192.168.0.3 5 | mode ipv4_first 6 | } 7 | 8 | error_log { 9 | priority notice 10 | filename /dev/stdout 11 | } 12 | 13 | access_log { 14 | priority notice 15 | filename /dev/stdout 16 | } 17 | 18 | listen 80 { 19 | proto http 20 | table http_hosts 21 | fallback 192.168.0.3:7890 22 | } 23 | 24 | listen 443 { 25 | proto tls 26 | table https_hosts 27 | fallback 192.168.0.3:7890 28 | } 29 | 30 | table http_hosts{ 31 | .* * 32 | } 33 | 34 | table https_hosts{ 35 | .* * 36 | } 37 | -------------------------------------------------------------------------------- /squid/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make file perl 3 | RUN SQUID_VERSION=squid-3.5.27 && wget http://www.squid-cache.org/Versions/v3/3.5/${SQUID_VERSION}.tar.xz && tar xJf ${SQUID_VERSION}.tar.xz && cd ${SQUID_VERSION} && ls -lha && \ 4 | export CFLAGS=-Os && export LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic" && ./configure --disable-loadable-modules --disable-icap-client --disable-wccp --disable-wccpv2 --disable-snmp --disable-eui --disable-htcp --disable-select --disable-ident-lookups --disable-auto-locale --disable-auth-basic --disable-auth-digest --disable-auth-negotiate --disable-auth-ntlm --disable-external-acl-helpers --disable-url-rewrite-helpers --disable-storeid-rewrite-helpers && make -j4 && make install 5 | RUN strip -s /usr/local/squid/bin/* /usr/local/squid/sbin/* /usr/local/squid/libexec/cachemgr.cgi /usr/local/squid/libexec/diskd /usr/local/squid/libexec/log_file_daemon /usr/local/squid/libexec/unlinkd 6 | 7 | FROM alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /usr/local/squid/bin/ /usr/local/bin/ 10 | COPY --from=build /usr/local/squid/sbin/ /usr/local/sbin/ 11 | COPY --from=build /usr/local/squid/libexec/cachemgr.cgi /usr/local/squid/libexec/cachemgr.cgi 12 | COPY --from=build /usr/local/squid/libexec/diskd /usr/local/squid/libexec/diskd 13 | COPY --from=build /usr/local/squid/libexec/log_file_daemon /usr/local/squid/libexec/log_file_daemon 14 | COPY --from=build /usr/local/squid/libexec/unlinkd /usr/local/squid/libexec/unlinkd 15 | COPY --from=build /usr/local/squid/etc/squid.conf /usr/local/squid/etc/squid.conf 16 | COPY --from=build /usr/local/squid/etc/mime.conf /usr/local/squid/etc/mime.conf 17 | COPY --from=build /usr/local/squid/share/errors/templates /usr/local/squid/share/errors/templates 18 | COPY --from=build /usr/local/squid/share/icons /usr/local/squid/share/icons 19 | RUN cd /usr/local/squid/ && mkdir -p var/logs var/run var/cache && chmod 777 var/logs var/cache -------------------------------------------------------------------------------- /squid/README.MD: -------------------------------------------------------------------------------- 1 | ## squid 2 | 3 | 4 | 5 | tiny example conf 6 | ``` 7 | http_port 127.0.0.1:3128 8 | http_access allow localhost 9 | cache deny all 10 | access_log none 11 | dns_v4_first on 12 | via off 13 | forwarded_for delete 14 | sslproxy_cert_error allow all 15 | sslproxy_flags DONT_VERIFY_PEER 16 | ``` 17 | 18 | start `squid -f /path/to/config -N` 19 | 20 | 21 | 22 | ``` 23 | icon_directory /usr/local/squid/share/icons 24 | ``` 25 | 26 | 27 | 28 | 29 | ## dockerfile 30 | 31 | https://github.com/suconghou/docker/tree/master/squid 32 | 33 | 34 | docker image https://hub.docker.com/r/suconghou/squid/ 35 | 36 | 37 | -------------------------------------------------------------------------------- /squid/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/squid . -------------------------------------------------------------------------------- /sshd/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make zlib-dev zlib-static openssl-dev openssl-libs-static 3 | RUN OPENSSH_VERSION=openssh-9.4p1 && wget http://ftp.jaist.ac.jp/pub/OpenBSD/OpenSSH/portable/${OPENSSH_VERSION}.tar.gz && tar xzf ${OPENSSH_VERSION}.tar.gz && cd ${OPENSSH_VERSION} && ls -lha && \ 4 | ./configure && make -j2 CFLAGS=-Os LDFLAGS="-static -L./ -L./openbsd-compat/" && make install 5 | RUN strip -s /usr/local/bin/ssh /usr/local/bin/scp /usr/local/bin/sftp /usr/local/bin/ssh-keygen /usr/local/sbin/sshd 6 | 7 | FROM alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /usr/local/bin/ssh /usr/local/bin/ssh 10 | COPY --from=build /usr/local/bin/scp /usr/local/bin/scp 11 | COPY --from=build /usr/local/bin/sftp /usr/local/bin/sftp 12 | COPY --from=build /usr/local/bin/ssh-keygen /usr/local/bin/ssh-keygen 13 | COPY --from=build /usr/local/sbin/sshd /usr/local/sbin/sshd 14 | RUN mkdir -p /usr/local/etc/ && echo 'PermitRootLogin yes' > /usr/local/etc/sshd_config && ssh-keygen -t dsa -f /usr/local/etc/ssh_host_dsa_key -N '' && ssh-keygen -t rsa -f /usr/local/etc/ssh_host_rsa_key -N '' && ssh-keygen -t ecdsa -f /usr/local/etc/ssh_host_ecdsa_key -N '' && ssh-keygen -t ed25519 -f /usr/local/etc/ssh_host_ed25519_key -N '' && echo "root:sch@dockerssh" | chpasswd 15 | CMD ["/usr/local/sbin/sshd","-D"] 16 | EXPOSE 22 17 | -------------------------------------------------------------------------------- /sshd/Dockerfile-arm64v8: -------------------------------------------------------------------------------- 1 | FROM arm64v8/alpine AS build 2 | RUN apk add --update gcc g++ make zlib-dev zlib-static openssl-dev openssl-libs-static 3 | RUN OPENSSH_VERSION=openssh-9.4p1 && wget http://ftp.jaist.ac.jp/pub/OpenBSD/OpenSSH/portable/${OPENSSH_VERSION}.tar.gz && tar xzf ${OPENSSH_VERSION}.tar.gz && cd ${OPENSSH_VERSION} && ls -lha && \ 4 | ./configure && make -j2 CFLAGS=-Os LDFLAGS="-static -L./ -L./openbsd-compat/" && make install 5 | RUN strip -s /usr/local/bin/ssh /usr/local/bin/scp /usr/local/bin/sftp /usr/local/bin/ssh-keygen /usr/local/sbin/sshd 6 | 7 | FROM arm64v8/alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /usr/local/bin/ssh /usr/local/bin/ssh 10 | COPY --from=build /usr/local/bin/scp /usr/local/bin/scp 11 | COPY --from=build /usr/local/bin/sftp /usr/local/bin/sftp 12 | COPY --from=build /usr/local/bin/ssh-keygen /usr/local/bin/ssh-keygen 13 | COPY --from=build /usr/local/sbin/sshd /usr/local/sbin/sshd 14 | RUN mkdir -p /usr/local/etc/ && echo 'PermitRootLogin yes' > /usr/local/etc/sshd_config && ssh-keygen -t dsa -f /usr/local/etc/ssh_host_dsa_key -N '' && ssh-keygen -t rsa -f /usr/local/etc/ssh_host_rsa_key -N '' && ssh-keygen -t ecdsa -f /usr/local/etc/ssh_host_ecdsa_key -N '' && ssh-keygen -t ed25519 -f /usr/local/etc/ssh_host_ed25519_key -N '' && echo "root:sch@dockerssh" | chpasswd 15 | CMD ["/usr/local/sbin/sshd","-D"] 16 | EXPOSE 22 17 | -------------------------------------------------------------------------------- /sshd/Dockerfile-dropbear: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && \ 3 | apk add --update gcc g++ make wget linux-headers 4 | RUN DROPBEAR_VERSION=dropbear-2022.83 && wget --no-check-certificate https://matt.ucc.asn.au/dropbear/releases/${DROPBEAR_VERSION}.tar.bz2 && tar jxf ${DROPBEAR_VERSION}.tar.bz2 && cd ${DROPBEAR_VERSION} && ls -lha && \ 5 | CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-static -Wl,--gc-sections" ./configure --disable-zlib && make -j2 && make install 6 | RUN strip -s /usr/local/bin/dbclient /usr/local/bin/dropbearconvert /usr/local/bin/dropbearkey /usr/local/sbin/dropbear 7 | 8 | FROM alpine 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /usr/local/bin/dbclient /usr/local/bin/dbclient 11 | COPY --from=build /usr/local/bin/dropbearconvert /usr/local/bin/dropbearconvert 12 | COPY --from=build /usr/local/bin/dropbearkey /usr/local/bin/dropbearkey 13 | COPY --from=build /usr/local/sbin/dropbear /usr/local/sbin/dropbear 14 | RUN mkdir -p /etc/dropbear && echo "root:sch@dockerdropbear" | chpasswd 15 | CMD ["/usr/local/sbin/dropbear","-F","-E","-R"] 16 | EXPOSE 22 17 | -------------------------------------------------------------------------------- /sshd/Dockerfile-dropbear-arm64v8: -------------------------------------------------------------------------------- 1 | FROM arm64v8/alpine AS build 2 | RUN apk add --update gcc g++ make wget linux-headers 3 | RUN DROPBEAR_VERSION=dropbear-2020.81 && wget --no-check-certificate https://matt.ucc.asn.au/dropbear/releases/${DROPBEAR_VERSION}.tar.bz2 && tar jxf ${DROPBEAR_VERSION}.tar.bz2 && cd ${DROPBEAR_VERSION} && ls -lha && \ 4 | CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-static -Wl,--gc-sections" ./configure --disable-zlib && make -j2 && make install 5 | RUN strip -s /usr/local/bin/dbclient /usr/local/bin/dropbearconvert /usr/local/bin/dropbearkey /usr/local/sbin/dropbear 6 | 7 | FROM arm64v8/alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /usr/local/bin/dbclient /usr/local/bin/dbclient 10 | COPY --from=build /usr/local/bin/dropbearconvert /usr/local/bin/dropbearconvert 11 | COPY --from=build /usr/local/bin/dropbearkey /usr/local/bin/dropbearkey 12 | COPY --from=build /usr/local/sbin/dropbear /usr/local/sbin/dropbear 13 | RUN mkdir -p /etc/dropbear && echo "root:sch@dockerdropbear" | chpasswd 14 | CMD ["/usr/local/sbin/dropbear","-F","-E","-R"] 15 | EXPOSE 22 16 | -------------------------------------------------------------------------------- /sshd/README.MD: -------------------------------------------------------------------------------- 1 | ### sshd 2 | 3 | 静态编译sshd 4 | 5 | 6 | ### 编译dropbear 7 | 8 | dropbear 是一个更加小巧的sshd 9 | 10 | https://matt.ucc.asn.au/dropbear/dropbear.html 11 | 12 | 静态编译十分容易 13 | 14 | `mkdir /etc/dropbear` 15 | 16 | 后台运行 `./dropbear -E -R` 17 | 18 | 不进入后台 `./dropbear -F -E -R` 19 | 20 | 21 | `dbclient` 是一个和ssh类似的客户端 22 | 23 | ### docker images 24 | 25 | https://hub.docker.com/r/suconghou/sshd/ 26 | 27 | ### dockerfile 28 | 29 | https://github.com/suconghou/docker/tree/master/sshd -------------------------------------------------------------------------------- /sshd/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/sshd -t=suconghou/sshd:8.9p1 . 3 | -------------------------------------------------------------------------------- /sshd/makedropbear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/sshd:dropbear . -f Dockerfile-dropbear 3 | -------------------------------------------------------------------------------- /stunserver/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk --update add gcc g++ make openssl-dev openssl-libs-static boost-dev boost-static 3 | RUN wget -O- http://www.stunprotocol.org/stunserver-1.2.16.tgz | tar xz --strip 1 && \ 4 | make CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-Wl,--gc-sections -static" && \ 5 | strip -s stunclient stunserver stuntestcode 6 | 7 | 8 | FROM busybox 9 | LABEL maintainer="suconghou@gmail.com" 10 | COPY --from=build /stunclient /stunserver /stuntestcode /usr/local/bin/ 11 | -------------------------------------------------------------------------------- /tools/README.MD: -------------------------------------------------------------------------------- 1 | ## tools 2 | 3 | > static build ngrep 4 | 5 | 6 | ## Dockerfile 7 | 8 | https://github.com/suconghou/docker/tree/master/tools 9 | 10 | docker image https://hub.docker.com/r/suconghou/tools/ 11 | -------------------------------------------------------------------------------- /tools/brook/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | ADD https://github.com/txthinking/brook/releases/download/v20180909/brook /brook 3 | RUN apk add binutils && chmod +x brook && strip -s brook 4 | 5 | FROM scratch 6 | LABEL maintainer="suconghou@gmail.com" 7 | COPY --from=build /brook / 8 | ENTRYPOINT ["/brook"] 9 | CMD ["server","-l",":18123","-p","su"] 10 | -------------------------------------------------------------------------------- /tools/brook/README.MD: -------------------------------------------------------------------------------- 1 | ## brook 2 | 3 | 4 | ` alias bclient="brook client -l 127.0.0.1:1080 -i 127.0.0.1 -s x.x.x.x:18123 -p su" ` 5 | -------------------------------------------------------------------------------- /tools/brook/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/tools:brook . 3 | -------------------------------------------------------------------------------- /tools/brook/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker run --rm -it -p 18123:18123 -p 18123:18123/udp suconghou/tools:brook 3 | -------------------------------------------------------------------------------- /tools/goaccess/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update wget gcc g++ make file 3 | RUN wget -O- https://github.com/maxmind/geoip-api-c/releases/download/v1.6.32/GeoIP-1.6.32.tar.gz | tar xz && \ 4 | cd GeoIP-1.6.32 && ./configure && make && make install 5 | RUN wget -O- http://ftp.gnu.org/gnu/ncurses/ncurses-6.1.tar.gz | tar xz && \ 6 | cd ncurses-6.1 && ./configure --enable-widec && make && make install 7 | RUN GOACCESS_VERSION=goaccess-1.2 && wget -O- http://tar.goaccess.io/${GOACCESS_VERSION}.tar.gz | tar xz && \ 8 | cd $GOACCESS_VERSION && CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" ./configure --enable-utf8 --enable-geoip=legacy && \ 9 | make && make install && strip -s /usr/local/bin/goaccess 10 | 11 | FROM alpine 12 | LABEL maintainer="suconghou@gmail.com" 13 | COPY --from=build /usr/local/bin/goaccess /usr/local/bin/ 14 | 15 | -------------------------------------------------------------------------------- /tools/goaccess/README.MD: -------------------------------------------------------------------------------- 1 | ## goaccess 2 | 3 | https://goaccess.io/download 4 | 5 | static build goaccess 6 | 7 | 8 | `docker build -t=suconghou/tools:goaccess .` 9 | 10 | https://dev.maxmind.com/geoip/legacy/geolite/ 11 | 12 | ``` 13 | wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz 14 | ``` 15 | 16 | ``` 17 | docker run --rm -it -m 160m \ 18 | -p 127.0.0.1:7890:7890 \ 19 | -v /var/log/nginx:/data \ 20 | -v /data/db:/data/db \ 21 | suconghou/tools:goaccess \ 22 | goaccess /data/access.log \ 23 | -o /data/report.html \ 24 | --log-format=COMBINED \ 25 | --real-time-html \ 26 | --geoip-database /data/db/GeoIP.dat \ 27 | --ws-url ws://report.tuwenzhibo.com:80/ws 28 | ``` 29 | 30 | 31 | ## Dockerfile 32 | 33 | https://github.com/suconghou/docker/tree/master/tools/goaccess 34 | 35 | docker image https://hub.docker.com/r/suconghou/tools/tags/ 36 | -------------------------------------------------------------------------------- /tools/gost/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | ADD https://github.com/ginuerzh/gost/releases/download/v2.7.0/gost_2.7.0_linux_amd64.tar.gz / 3 | RUN apk add binutils && tar xzv --strip 1 -f *.gz && strip -s gost 4 | 5 | FROM scratch 6 | LABEL maintainer="suconghou@gmail.com" 7 | COPY --from=build /gost /usr/local/bin/ 8 | CMD ["gost","-L","sni://:6443"] 9 | -------------------------------------------------------------------------------- /tools/gost/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/tools:gost . 3 | -------------------------------------------------------------------------------- /tools/httptunnel/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make curl automake autoconf 3 | RUN curl -sSL https://github.com/larsbrinkhoff/httptunnel/archive/master.tar.gz | tar xz --strip 1 && ls -lha 4 | RUN ./autogen.sh && CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" ./configure && \ 5 | make && strip -s hts htc 6 | 7 | FROM alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /hts /htc /usr/local/bin/ 10 | -------------------------------------------------------------------------------- /tools/httptunnel/README.MD: -------------------------------------------------------------------------------- 1 | ## httptunnel 2 | 3 | https://github.com/larsbrinkhoff/httptunnel 4 | 5 | static build httptunnel 6 | 7 | 8 | ## Dockerfile 9 | 10 | https://github.com/suconghou/docker/tree/master/tools/httptunnel 11 | 12 | docker image https://hub.docker.com/r/suconghou/tools/tags/ 13 | 14 | ## relative 15 | 16 | https://github.com/jpillora/chisel 17 | 18 | https://github.com/mmatczuk/go-http-tunnel 19 | -------------------------------------------------------------------------------- /tools/httptunnel/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/tools:httptunnel . 3 | -------------------------------------------------------------------------------- /tools/ngrep/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make curl libpcap-dev perl 3 | RUN NGREP_VERION=V1_47 && curl -sSL https://github.com/jpr5/ngrep/archive/${NGREP_VERION}.tar.gz | tar xz --strip 1 && ls -lha 4 | RUN CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" ./configure && \ 5 | make && strip -s ngrep 6 | 7 | FROM alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /ngrep /usr/local/bin/ngrep 10 | -------------------------------------------------------------------------------- /tools/ngrep/Dockerfile-arm64v8: -------------------------------------------------------------------------------- 1 | FROM arm64v8/alpine AS build 2 | RUN apk add --update gcc g++ make curl libpcap-dev perl 3 | RUN NGREP_VERION=V1_47 && curl -sSL https://github.com/jpr5/ngrep/archive/${NGREP_VERION}.tar.gz | tar xz --strip 1 && ls -lha 4 | RUN CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" ./configure && \ 5 | make && strip -s ngrep 6 | 7 | FROM arm64v8/alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /ngrep /usr/local/bin/ngrep 10 | -------------------------------------------------------------------------------- /tools/ngrep/README.MD: -------------------------------------------------------------------------------- 1 | ## ngrep 2 | 3 | https://github.com/jpr5/ngrep 4 | 5 | static build ngrep 6 | 7 | ngrep version 1.47 8 | 9 | static build tcpdump for arm 10 | 11 | https://github.com/andrew-d/static-binaries/tree/master/binaries/linux/arm 12 | 13 | 14 | ## Dockerfile 15 | 16 | https://github.com/suconghou/docker/tree/master/tools/ngrep 17 | 18 | docker image https://hub.docker.com/r/suconghou/tools/tags/ 19 | 20 | 21 | -------------------------------------------------------------------------------- /tools/ngrep/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/tools:ngrep . 3 | -------------------------------------------------------------------------------- /tools/suexec/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make 3 | RUN wget -O- https://github.com/ncopa/su-exec/archive/master.tar.gz | tar xz --strip 1 && export CFLAGS="-Wall -Werror -s" && make && make su-exec-static 4 | 5 | FROM alpine 6 | LABEL maintainer="suconghou@gmail.com" 7 | COPY --from=build /su-exec /su-exec-static /usr/local/sbin/ 8 | -------------------------------------------------------------------------------- /tools/suexec/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/tools:suexec . 3 | -------------------------------------------------------------------------------- /tools/tcpflow/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update gcc g++ make libpcap-dev zlib-dev zlib-static openssl-dev openssl-libs-static boost-dev 3 | RUN wget -O- https://github.com/simsong/tcpflow/releases/download/tcpflow-1.5.0/tcpflow-1.5.0.tar.gz | tar xz --strip 1 4 | RUN CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" ./configure && \ 5 | make && strip -s src/tcpflow 6 | 7 | FROM alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /src/tcpflow /usr/local/bin/ 10 | -------------------------------------------------------------------------------- /tools/tcpflow/README.MD: -------------------------------------------------------------------------------- 1 | ## tcpflow 2 | 3 | static build tcpflow 4 | 5 | -------------------------------------------------------------------------------- /tools/tcpflow/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t=suconghou/tools:tcpflow . 3 | -------------------------------------------------------------------------------- /tools/wrk/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine AS build 2 | RUN apk add --update alpine-sdk perl 3 | RUN git clone -b 4.0.2 https://github.com/wg/wrk 4 | RUN cd wrk && CFLAGS="-Os -ffunction-sections -fdata-sections" LDFLAGS="-static-libstdc++ -static-libgcc --static -Wl,-Bstatic,--gc-sections" make && \ 5 | strip -s wrk 6 | 7 | FROM alpine 8 | LABEL maintainer="suconghou@gmail.com" 9 | COPY --from=build /wrk/wrk /usr/local/bin/ 10 | -------------------------------------------------------------------------------- /tools/wrk/README.MD: -------------------------------------------------------------------------------- 1 | ## wrk 2 | 3 | https://github.com/wg/wrk 4 | 5 | static build wrk 6 | 7 | `docker build -t=suconghou/tools:wrk .` 8 | 9 | 10 | ## Dockerfile 11 | 12 | https://github.com/suconghou/docker/tree/master/tools/wrk 13 | 14 | docker image https://hub.docker.com/r/suconghou/tools/tags/ 15 | -------------------------------------------------------------------------------- /tools/zstd/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | RUN apk add --update --no-cache make gcc g++ 3 | RUN wget -O- https://github.com/facebook/zstd/releases/download/v1.4.3/zstd-1.4.3.tar.gz | tar xz --strip 1 && \ 4 | make CFLAGS="-O3 -ffunction-sections -fdata-sections" LDFLAGS="-static -Wl,--gc-sections" -j4 5 | --------------------------------------------------------------------------------