Postgres With Jieba

拷贝从Gist那边过来的代码 # Azurewind's PostgreSQL image with Chinese full text searchi using pg_jieba # FROM postgres:15-alpine FROM postgres:16-alpine ENV LANG zh_CN.utf8 RUN apk add --no-cache --virtual .build \ postgresql-dev \ gcc \ make \ llvm15 \ libc-dev \ g++ \ clang15 \ git \ cmake \ curl \ openssl-dev && \ git clone https://github.com/jaiminpan/pg_jieba && \ cd /pg_jieba && \ git submodule update --init --recursive && \ mkdir -p build && \ cd build && \ curl -L https://raw....

<span title='2023-10-25 09:42:31 +0000 UTC'>2023/10/25 Oct</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;153 words&nbsp;·&nbsp;SCys

Postgres Locale Change in Docker

调整PG的本地语言,因为建立数据全文搜索可以用到, create new Dockerfile as blew codes: FROM postgres:15-bullseye RUN localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8 ENV LANG zh_CN.utf8 support docker images list: postgres:15-bullseye postgres:14-bullseye postgres:13-bullseye

<span title='2023-05-22 15:42:31 +0000 UTC'>2023/05/22 May</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;29 words&nbsp;·&nbsp;SCys

不停机 - 清理 Docker 日志

不停机即可清理 Docker 的日志 # 检查占用多少空间 $ sudo sh -c 'du -sh /var/lib/docker/containers/*/*-json.log' # 全部清理 $ sudo sh -c 'truncate -s 0 /var/lib/docker/containers/*/*-json.log' # 指定某个容器清理 $ truncate -s 0 $(docker inspect --format='{{.LogPath}}' <container_name_or_id>) 来自 Stackoverflow #41091634

<span title='2022-09-19 20:13:01 +0800 +0800'>2022/09/19 Sep</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;35 words&nbsp;·&nbsp;SCys

Docker 的基本配置

Docker 快速配置文件 保存 /etc/docker/daemon.json { "registry-mirrors": [ "https://05f073ad3c0010ea0f4bc00b7105ec20.mirror.swr.myhuaweicloud.com/", "http://hub-mirror.c.163.com/" ], "dns": ["114.114.114.114", "223.5.5.5"], "log-driver": "json-file", "log-opts": { "max-size": "10m", "max-file": "3", "labels": "production_status", "env": "os,customer" } } 扩展的配置,配置 nvidia 的直连,需要 nvidia-container。 { "runtimes": { "nvidia": { "path": "nvidia-container-runtime", "runtimeArgs": [] } }, "default-runtime": "nvidia", "registry-mirrors": [ "https://docker.mirrors.ustc.edu.cn" ], "dns": ["1.0.0.1", "223.5.5.5"], "log-driver": "json-file", "log-level": "error", "log-opts": { "cache-disabled": "false", "cache-max-file": "5", "cache-max-size": "20m", "cache-compress": "true", "env": "os,customer", "max-file": "5", "max-size": "10m" } } Docker Hub 的镜像 华为: 定制公开镜像,需要到 华为云 注册建立...

<span title='2020-11-25 10:05:05 +0800 +0800'>2020/11/25 Nov</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;95 words&nbsp;·&nbsp;SCys