Drone是一款轻量级持续集成/持续部署(CI/CD)工具,基于Docker容器技术构建。它能够与主流代码托管平台(如GitHub、GitLab、Bitbucket等)无缝集成,自动化执行代码构建、测试和部署流程,帮助开发团队提高开发效率和代码质量。Drone设计简洁,配置灵活,支持多种数据库和部署方式,适合各类规模的开发项目使用。
注意:强烈建议Docker使用AUFS存储驱动。可通过以下命令验证:
shsudo docker info | grep Driver:
注意:当前项目处于alpha阶段,使用时请注意风险。
shwget downloads.drone.io/master/drone.deb sudo dpkg -i drone.deb
shwget downloads.drone.io/master/drone.rpm sudo yum localinstall drone.rpm
Drone默认使用SQLite数据库,同时支持PostgreSQL和MySQL。可通过配置文件自定义数据库设置:
toml[database] driver="postgres" datasource="host=127.0.0.1 user=postgres dbname=drone sslmode=disable"
toml[database] driver="mysql" datasource="root@tcp(127.0.0.1:3306)/drone"
Drone支持通过配置文件或环境变量进行设置,也可混合使用两种方式。
配置文件采用TOML格式,默认路径为/etc/drone/drone.toml(通过deb包安装时)。启动时可指定自定义配置文件路径:
shdroned --config=/path/to/drone.toml
完整配置文件示例:
toml[server] port="" [server.ssl] key="" cert="" [session] secret="" expires="" [database] driver="" datasource="" [github] client="" secret="" orgs=[] open=false [github_enterprise] client="" secret="" api="" url="" orgs=[] private_mode=false open=false [bitbucket] client="" secret="" open=false [gitlab] url="" client="" secret="" skip_verify=false open=false [gogs] url="" secret="" open=false [smtp] host="" port="" from="" user="" pass="" [docker] cert="" key="" [worker] nodes=[ "unix:///var/run/docker.sock", "unix:///var/run/docker.sock" ]
可通过环境变量设置所有配置参数,示例如下:
sh# 服务器设置 export DRONE_SERVER_PORT="" export DRONE_SERVER_SSL_KEY="" export DRONE_SERVER_SSL_CERT="" # 会话设置 export DRONE_SESSION_SECRET="" export DRONE_SESSION_EXPIRES="" # 数据库设置 export DRONE_DATABASE_DRIVER="" export DRONE_DATABASE_DATASOURCE="" # GitHub 配置 export DRONE_GITHUB_CLIENT="" export DRONE_GITHUB_SECRET="" export DRONE_GITHUB_OPEN=false # GitHub Enterprise 配置 export DRONE_GITHUB_ENTERPRISE_CLIENT="" export DRONE_GITHUB_ENTERPRISE_SECRET="" export DRONE_GITHUB_ENTERPRISE_API="" export DRONE_GITHUB_ENTERPRISE_URL="" export DRONE_GITHUB_ENTERPRISE_PRIVATE_MODE=false export DRONE_GITHUB_ENTERPRISE_OPEN=false # Bitbucket 配置 export DRONE_BITBUCKET_CLIENT="" export DRONE_BITBUCKET_SECRET="" export DRONE_BITBUCKET_OPEN=false # GitLab 配置 export DRONE_GITLAB_URL="" export DRONE_GITLAB_CLIENT="" export DRONE_GITLAB_SECRET="" export DRONE_GITLAB_SKIP_VERIFY=false export DRONE_GITLAB_OPEN=false # 邮件配置 export DRONE_SMTP_HOST="" export DRONE_SMTP_PORT="" export DRONE_SMTP_FROM="" export DRONE_SMTP_USER="" export DRONE_SMTP_PASS="" # Worker 节点 export DRONE_WORKER_NODES="tcp://0.0.0.0:2375,tcp://0.0.0.0:2375"
可同时使用环境变量和配置文件:
shDRONE_GITLAB_URL="https://gitlab.com" droned --config=/path/to/drone.conf
要与GitHub集成,需在GitHub上注册应用:
访问 https://github.com/settings/applications/new
填写以下信息:
http://localhost:8000/(本地运行时,服务器部署需替换为实际域名)http://localhost:8000/api/auth/github.comhttp://localhost:8000/api/auth/enterprise.github.com需在代码仓库根目录添加 .drone.yml 文件定义构建流程。关于 .drone.yml 格式的详细说明,请参考 https://github.com/drone/drone/blob/v0.2.1/README.md#builds%E3%80%82
从0.2版本升级时请注意:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。





探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务