Skip to content

镜像UI上传工具:轻松上传镜像到镜像仓库(支持Harbor 和阿里云),支持 Docker、K8s、本地离线化部署,解决各场景上传镜像问题。 Push Image via UI: Easily upload images to image repositories (supports Harbor and Alibaba Cloud), compatible with Docker, Kubernetes, and local offline deployment, solving image upload issues across various scenarios.

License

Notifications You must be signed in to change notification settings

404name/docker-tar-push-ui

Repository files navigation

一、镜像UI上传工具

二、项目使用和注意

2.1 运行项目

资源下载

项目运行

  • linux: ./docker-tar-push-ui server --port=8088
  • windows: ./docker-tar-push-ui.exe server --port=8088
  • docker: mkdir -p /data/uploads && chmod -R 777 /data/uploads && docker run -d --name docker-tar-push-ui -p 8088:8088 -v /data/uploads:/app/uploads 404name/docker-tar-push-ui:latest
  • k8s: kubectl apply -f ./deploy.yaml

2.2 功能

  • 支持上传harbor / 阿里云
  • 支持UI模式和命令行两种模式

2.3 如何制作离线镜像包

[tip] 也可以参考github-action里面写入需要拉取的镜像,自动通过release发布离线包(这个后续会单独提供一个分支做这个)

  1. 拉取镜像:docker pull m.daocloud.io/library/nginx:latest
  2. 镜像打tag: docker tag m.daocloud.io/librarynginx:latest nginx:latest
  3. 保存离线镜像包:docker save -o nginx.tar nginx:latest
  4. 使用这个nginx.tar就可以通过UI直接上传到镜像仓库了

都有docker了,为啥不用docker推送 ==> 有的内网环境没有docker,下载也比较麻烦,而且离线镜像包可以一开始就制作好。

三、项目开发和维护

提交issue

本地开发

  • go mod tidy

  • go run ./ server

  • docker build -t docker-tar-push-ui:latest .

  • docker run -d --name docker-tar-push-ui -p 8088:8088 docker-tar-push-ui:latest

实现热加载

  • go get -u github.com/cosmtrek/air
  • air init
  • air

TODO

  • dockerfile打包
  • 流水线自动打包linux+windows+docker仓库 + 自动发布tag
  • YAML适配
  • 支持阿里云推送
  • 支持华为云和dockerhub等标准场景(网络限制,测试不了dockerhub)
  • 支持默认追加https://
  • 支持上传成功后提示
  • 支持界面下载镜像和对接harbor
  • 解决华为云推送的时候授权问题华为云的scope="repository:name404/alist:" 似乎需要适配下
2025/01/08 13:02:05 push.go:243: [INFO] Received Www-Authenticate header: Bearer realm="https://swr.cn-north-4.myhuaweicloud.com/swr/auth/v2/registry/auth/",service="dockyard",scope="repository:name404/alist:"
2025/01/08 13:02:05 auth.go:107: [INFO] Parsed Www-Authenticate header - realm: https://swr.cn-north-4.myhuaweicloud.com/swr/auth/v2/registry/auth/, service: dockyard, scope: repository:name404/alist:,push
2025/01/08 13:02:05 auth.go:22: [INFO] Parsed Www-Authenticate header - realm: https://swr.cn-north-4.myhuaweicloud.com/swr/auth/v2/registry/auth/, service: dockyard, scope: repository:name404/alist:,push
2025/01/08 13:02:05 auth.go:31: [INFO] Constructed token request data: map[password:[355d42dfa6a82ad2ea20f69d4f846522f59b3a4d116b2180115c5a789dea9cf9] scope:[repository:name404/alist:,push] service:[dockyard] username:[cn-north-4@9OU2ASO8F9VIDXZAXKC6]]
2025/01/08 13:02:05 auth.go:44: [INFO] Sending token request to https://swr.cn-north-4.myhuaweicloud.com/swr/auth/v2/registry/auth/
2025/01/08 13:02:05 auth.go:53: [INFO] Received token response with status code: 404
2025/01/08 13:02:05 auth.go:57: [ERROR] Token request failed with status code: 404

四、关于

contributors

Star History Chart

Star History Chart

License

MIT.

About

镜像UI上传工具:轻松上传镜像到镜像仓库(支持Harbor 和阿里云),支持 Docker、K8s、本地离线化部署,解决各场景上传镜像问题。 Push Image via UI: Easily upload images to image repositories (supports Harbor and Alibaba Cloud), compatible with Docker, Kubernetes, and local offline deployment, solving image upload issues across various scenarios.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published