
本Docker镜像预安装Git工具,专为Meltwater Drone.io CI/CD流水线设计,旨在提供便捷的Git操作环境,支持在流水线中执行代码拉取、版本控制、提交/推送等Git相关任务,简化流水线配置流程。
bashdocker run --rm -v $(pwd):/workspace -e GIT_USER_NAME="CI Bot" -e GIT_USER_EMAIL="ci@example.com" meltwater/drone-git-image git clone https://github.com/example/repo.git
在Drone.io .drone.yml 中使用:
yamlsteps: - name: git-operation image: meltwater/drone-git-image commands: - git config --global user.name "CI Bot" - git config --global user.email "ci@example.com" - git clone https://github.com/example/repo.git - cd repo - git checkout -b feature/new-ci - # 执行其他Git操作(如修改文件、提交、推送等)
环境变量
| 变量名 | 描述 | 默认值 |
|---|---|---|
GIT_USER_NAME | Git提交用户名称 | Drone CI Bot |
GIT_USER_EMAIL | Git提交用户*** | drone@example.com |
GIT_SSH_KEY | SSH私钥(用于Git SSH认证) | 无 |
GIT_CREDENTIALS | HTTP基础认证信息(格式:username:password) | 无 |
数据挂载
/workspace 路径,用于持久化Git操作结果/root/.ssh/id_rsabash# 克隆仓库 git clone https://github.com/example/repo.git # 创建并切换分支 git checkout -b new-branch # 添加文件并提交 git add . git commit -m "CI: Auto-generate report" # 推送到远程仓库 git push origin new-branch






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