Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于docker镜像重命名(alias) #204

Open
sydnkj opened this issue Nov 3, 2024 · 7 comments
Open

关于docker镜像重命名(alias) #204

sydnkj opened this issue Nov 3, 2024 · 7 comments

Comments

@sydnkj
Copy link

sydnkj commented Nov 3, 2024

有的项目就叫server,比如bitwarden/server,推送到阿里也是叫server,但是server并没有和其他的镜像重名,有没有办法让他重命名成bitwarden_server?

Some projects are called server. For example, BitWarden/Server, When i pushed to Ali's also called server, but server is not replaced with other mirrors. Is there a way to let him rename bitwarden_server?

@Aas-ee
Copy link

Aas-ee commented Nov 13, 2024

@sydnkj 有办法,可以参考 #153

@catch6
Copy link

catch6 commented Jan 26, 2025

@Aas-ee 不知道为何会这样

Image Image

@Aas-ee
Copy link

Aas-ee commented Jan 26, 2025

@Aas-ee 你那个修改版的坑死人,自己测试过吗,写了alias居然还要再拼,我已经指定了alias是bitnami-mysql,为毛会变成bitnami_bitnami-mysql

Image Image

@catch6

麻烦检查是否有完全按照示例进行书写,代码是否完全一致,我这测试是正常的

示例代码:
Image

效果
Image

结果
Image

最后,既然是使用别人的东西,麻烦有问题先好好检查一下是不是自己的原因,再友好发问

@catch6
Copy link

catch6 commented Jan 26, 2025

@Aas-ee 显然你没考虑有mysql:8.0的情况,看了你修改的脚本,还是用了原作者的重名规则,当出现重名加了bitnami_,但是实际上并没有存在重名,因为已经存在的是mysql,bitnami-mysql是不存在重名的,要使用alias就应该把原作者的重名判断去除掉

@catch6
Copy link

catch6 commented Jan 26, 2025

@Aas-ee 镜像列表你可以去测试,推送过去的镜像格式是这样:

Image
# =============== DB ===============
# MySQL
mysql:8.0
bitnami/mysql:8.0

# PostgreSQL
postgres:16
--alias=bitnami-postgresql bitnami/postgresql:16

# PostgreSQL & TimeScaleDB
--alias=timescale-timescaledb timescale/timescaledb:2.17.2-pg16

# MongoDB
mongo:8.0
--alias=bitnami-mongodb bitnami/mongodb:8.0

# Redis
redis:7.4
--alias=bitnami-redis bitnami/redis:7.4

# =============== Language ===============
# JDK
eclipse-temurin:21-jdk-alpine
eclipse-temurin:17-jdk-alpine
eclipse-temurin:11-jdk-alpine
eclipse-temurin:8-jdk-alpine

# NodeJS
node:22-alpine
node:20-alpine
node:18-alpine
node:16-alpine

# =============== Application ===============
# Nginx
nginx:1.27
--alias=bitnami-nginx bitnami/nginx:1.27

# Caddy
caddy:2-alpine

# EMQX
emqx:5.8
--alias=emqx-emqx emqx/emqx:5.8
--alias=emqx-emqx-arm64 --platform=linux/arm64 emqx/emqx:5.8

# Kafka
--alias=apache-kafka apache/kafka:3.9
--alias=bitnami-kafka bitnami/kafka:3.9

# Nacos
--alias=nacos-nacos-server nacos/nacos-server:v2.5.0

@Aas-ee
Copy link

Aas-ee commented Jan 26, 2025

@catch6 请检查是否使用了我fork项目的代码!下面是我使用你提供的txt文件后的效果

txt文件内容:
Image

结果:
Image

@catch6
Copy link

catch6 commented Jan 26, 2025

@Aas-ee 好吧,我最后fork了一份,修改了脚本,放弃了alias的方案

因为我觉得维护这些alias也挺费劲的,不如制定明确的转换规则,约定大于配置

mysql:8.0 => mysql:8.0
bitnami/mysql:8.0 => bitnami-mysql:8.0
bitnami/mysql:8.0@sha256:ec1e8d95b06e7f78c7f4ee0ed91f835dd39afff7c58e36ba1a4878732b60fcf9 => bitnami-mysql:8.0
--platform=linux/arm64 bitnami/mysql:8.0 => bitnami-mysql:8.0-linux-arm64
gcr.io/cadvisor/cadvisor:v0.39.3 => gcr.io-cadvisor-cadvisor:v0.39.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants