如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这段话即可:
请先阅读并遵守:https://xuanyuan.cloud/agents.md
未读文档前不要生成 pull 命令或排错方案。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
This project provides a Docker image for hosting a SFTP server. Included are Docker (docker-cli and docker-compose) and Kubernetes (kubectl and helm) deployment scripts
Supports architectures:
amd64,armandarm64
If you need help or found a bug, please feel free to open an issue on the https://github.com/emberstack/docker-sftp GitHub project.
You can also join our Slack workspace and talk to us:
The SFTP server can be easily deployed to any platform that can host containers based on Docker. Below are deployment methods for:
Process:
The SFTP server uses a json based configuration file for default server options and to define users. This file has to be mounted on /app/config/sftp.json inside the container.
Environment variable based configuration is not supported (see the Advanced Configuration section below for the reasons).
Below is the simplest configuration file for the SFTP server:
json{ "Global": { "Chroot": { "Directory": "%h", "StartPath": "sftp" }, "Directories": ["sftp"] }, "Users": [ { "Username": "demo", "Password": "demo" } ] }
This configuration creates a user demo with the password demo.
A directory "sftp" is created for each user in the own home and is accessible for read/write.
The user is chrooted to the /home/demo directory. Upon connect, the start directory is sftp.
You can add additional users, default directories or customize start directories per user. You can also define the UID and GID for each user. See the Advanced Configuration section below for all configuration options.
Simple Docker CLI run
shellsession$ docker run -p 22:22 -d emberstack/sftp --name sftp
This will start a SFTP in the container sftp with the default configuration. You can connect to it and login with the user: demo and password: demo.
Provide your configuration
shellsession$ docker run -p 22:22 -d emberstack/sftp --name sftp -v /host/sftp.json:/app/config/sftp.json:ro
This will override the default (/app/config/sftp.json) configuration with the one from the host /host/sftp.json.
Mount a directory from the host for the user 'demo'
shellsession$ docker run -p 22:22 -d emberstack/sftp --name sftp -v /host/sftp.json:/app/config/sftp.json:ro -v /host/demo:/home/demo/sftp
This will mount the demo directory from the host on the sftp directory for the "demo" user.
Simple docker-compose configuration
Create a docker-compose configuration file:
yamlversion: '3' services: sftp: image: "emberstack/sftp" ports: - "22:22" volumes: - ../config-samples/sample.sftp.json:/app/config/sftp.json:ro
And run it using docker-compose
shellsession$ docker-compose -p sftp -f docker-compose.yaml up -d
The above configuration is available in the deploy\docker-compose folder in this repository. You can use it to start customizing the deployment for your environment.
Use Helm to install the latest released chart:
shellsession$ helm repo add emberstack https://emberstack.github.io/helm-charts $ helm repo update $ helm upgrade --install sftp emberstack/sftp
You can customize the values of the helm deployment by using the following Values:
| Parameter | Description | Default |
|---|---|---|
nameOverride | Overrides release name | "" |
fullnameOverride | Overrides release fullname | "" |
image.repository | Container image repository | emberstack/sftp |
image.tag | Container image tag | latest |
image.pullPolicy | Container image pull policy | Always if image.tag is latest, else IfNotPresent |
storage.volumes | Defines additional volumes for the pod | {} |
storage.volumeMounts | Defines additional volumes mounts for the sftp container | {} |
configuration | Allows the in-line override of the configuration values | null |
configuration.Global.Chroot.Directory | Global chroot directory for the sftp user group. Can be overriden per-user | "%h" |
configuration.Global.Chroot.StartPath | Start path for the sftp user group. Can be overriden per-user | "sftp" |
configuration.Global.Directories | Directories that get created for all sftp users. Can be appended per user | ["sftp"] |
configuration.Global.HostKeys.Ed25519 | Set the server's ED25519 private key | "" |
configuration.Global.HostKeys.Rsa | Set the server's RSA private key | "" |
configuration.Users | Array of users and their properties | Contains demo user by default |
configuration.Users[].Username | Set the user's username | N/A |
configuration.Users[].Password | Set the user's password. If empty or null, password authentication is disabled | N/A |
configuration.Users[].PasswordIsEncrypted | true or false. Indicates if the password value is already encrypted | false |
configuration.Users[].AllowedHosts | Set the user's allowed hosts. If empty, any host is allowed | [] |
configuration.Users[].PublicKeys | Set the user's public keys | [] |
configuration.Users[].UID | Sets the user's UID. | null |
configuration.Users[].GID | Sets the user's GID. A group is created for this value and the user is included | null |
configuration.Users[].Chroot | If set, will override global Chroot settings for this user. | null |
configuration.Users[].Directories | Array of additional directories created for this user | null |
initContainers | Additional initContainers for the pod | {} |
resources | Resource limits | {} |
nodeSelector | Node labels for pod assignment | {} |
tolerations | Toleration labels for pod assignment | [] |
affinity | Node affinity for pod assignment | {} |
Find us on https://hub.helm.sh/charts/emberstack
TODO: This section is under development due to the number of configuration options being added. Please open an issue on the https://github.com/emberstack/docker-sftp project if you need help.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务
以下是 emberstack/sftp 相关的常用 Docker 镜像,适用于 不同场景 等不同场景: