拉镜像
bash
docker pull mintplexlabs/anythingllm
建目录
bash
export STORAGE_LOCATION=$HOME/anythingllm && \
mkdir -p $STORAGE_LOCATION && \
touch "$STORAGE_LOCATION/.env"
检查目录具有写权限
bash
# 为目录anythingllm赋写权限
chmod 777 anythingllm
启anythingllm
bash
docker run -d \
--name anythingllm \
--add-host=host.docker.internal:host-gateway \
--env STORAGE_DIR=/app/server/storage \
--health-cmd "/bin/bash /usr/local/bin/docker-healthcheck.sh || exit 1" \
--health-interval 60s \
--health-start-period 60s \
--health-timeout 10s \
-p 3001:3001/tcp \
--restart=always \
--user anythingllm \
-v ${STORAGE_LOCATION}:/app/server/storage \
-v ${STORAGE_LOCATION}/.env:/app/server/.env \
-w /app \
mintplexlabs/anythingllm
其它常用docker命令
bash
# 列出所有容器的详细信息
#包括容器ID、容器名称、所使用的镜像、容器状态、创建时间等
docker ps -a
# 查看容器运行日志
docker logs 容器Id或容器名称
# 删除单个运行中的容器
docker rm -f 容器Id或容器名称