centos 用 docker 方式安装 dufs

首先安装 docker 环境

Alibaba Cloud Linux 3 安装 docker-CSDN博客

下载dufs镜像

复制代码
docker pull sigoden/dufs

部署dufs应用

  • 创建部署目录

    mkdir -p /app/dufs/data && cd /app/dufs/

  • 设置目录权限

    chmod 777 -R /app/dufs/

配置参照

复制代码
Dufs is a distinctive utility file server - https://github.com/sigoden/dufs

Usage: dufs [OPTIONS] [serve-path]

Arguments:
  [serve-path]  Specific path to serve [default: .]

Options:
  -c, --config <file>        Specify configuration file
  -b, --bind <addrs>         Specify bind address or unix socket
  -p, --port <port>          Specify port to listen on [default: 5000]
      --path-prefix <path>   Specify a path prefix
      --hidden <value>       Hide paths from directory listings, e.g. tmp,*.log,*.lock
  -a, --auth <rules>         Add auth roles, e.g. user:pass@/dir1:rw,/dir2
  -A, --allow-all            Allow all operations
      --allow-upload         Allow upload files/folders
      --allow-delete         Allow delete files/folders
      --allow-search         Allow search files/folders
      --allow-symlink        Allow symlink to files/folders outside root directory
      --allow-archive        Allow download folders as archive file
      --enable-cors          Enable CORS, sets `Access-Control-Allow-Origin: *`
      --render-index         Serve index.html when requesting a directory, returns 404 if not found index.html
      --render-try-index     Serve index.html when requesting a directory, returns directory listing if not found index.html
      --render-spa           Serve SPA(Single Page Application)
      --assets <path>        Set the path to the assets directory for overriding the built-in assets
      --log-format <format>  Customize http log format
      --log-file <file>      Specify the file to save logs to, other than stdout/stderr
      --compress <level>     Set zip compress level [default: low] [possible values: none, low, medium, high]
      --completions <shell>  Print shell completion script for <shell> [possible values: bash, elvish, fish, powershell, zsh]
      --tls-cert <path>      Path to an SSL/TLS certificate to serve with HTTPS
      --tls-key <path>       Path to the SSL/TLS certificate's private key
  -h, --help                 Print help
  -V, --version              Print version

编辑部署文件

  • 可以直接使用docker-cli方式部署

    docker run -v pwd:/data -p 5000:5000 --rm sigoden/dufs /data -A

  • 编辑docker-compose.yaml部署文件

    version: '3'
    services:
    dufs:
    image: sigoden/dufs
    ports:
    - '5000:5000'
    volumes:
    - /app/dufs/data:/data
    command: /data -A
    restart: always

可以设置路径别名:command: /data -A --path-prefix dufs

启动镜像

复制代码
docker compose up -d

卸载镜像

复制代码
docker compose down

现在可以访问 dufs 了

相关推荐
ARM|X86+FPGA工业主板厂家2 小时前
基于Jetson TX2的矿用巡检机器人
linux·运维·机器人
杨云龙UP2 小时前
Oracle 19c RMAN历史备份清理失败:CONTROL_FILE_RECORD_KEEP_TIME 问题排查与整改实战
linux·运维·网络·数据库·oracle·rac
Alphapeople3 小时前
moveit真机部署
linux·运维·服务器
Eminem893 小时前
2、k8s环境规划
linux·运维·kubernetes
NJCloud3 小时前
Docker 镜像管理:分层结构、构建优化与最佳实践
java·docker·容器
harmony&4 小时前
Docker 容器技术从入门到实战:生态系统、安装部署与架构详解
docker·容器·架构
打团从来人不齐4 小时前
Linux服务器搭建笔记-008:台式机共享WIFI
linux·服务器·笔记
天天喝旺仔4 小时前
Docker 镜像瘦身实战:多阶段构建把体积缩小 90%
运维·后端·ci/cd·docker·云原生·容器·性能优化
NJCloud4 小时前
Docker 私有仓库部署:Registry、加密传输与认证鉴权
运维·网络·docker·云原生·容器
w200512244 小时前
K8S控制器管理
linux·云原生·容器·kubernetes