xuxueli / xxl-job

A distributed task scheduling framework.(分布式任务调度平台XXL-JOB)
http://www.xuxueli.com/xxl-job/
GNU General Public License v3.0
27.4k stars 10.84k forks source link

docker 镜像可以添加一个arm版本的吗?某些国产化服务器要求ARM版本 #3169

Open llb0828 opened 1 year ago

llb0828 commented 1 year ago

docker 镜像可以添加一个arm版本的吗?某些国产化服务器要求ARM版本

  1. 本人所在公司是做政府相关的项目的, 能看到目前政府项目国产化浪潮越来越大, 服务也有部分是转用arm架构的了, xxljob在docker hub上的官方镜像并不能运行在arm服务器上
  2. 同时, 随着苹果M系列芯片的逐步推出, arm芯片作为程序员开发机也会越来越多, 想拉docker镜像直接开跑也是会报错的

基于以上问题, 麻烦大佬考虑一下推出一个arm版本的镜像, 拜谢!!

togetherstudy commented 1 year ago

dockerfile add FROM --platform=linux/amd64

MarkQiu92 commented 1 year ago

国产化可以用docker?

ukhack commented 1 year ago

服务不过就是个jar包,自己打个docker image应该很简单呀

shilintan commented 5 months ago

Dockerfile

FROM docker.io/xuxueli/xxl-job-admin:2.4.0 as file
FROM openjdk:8-jre-slim
COPY --from=file /app.jar /app.jar
ENV PARAMS=""
ENV TZ=PRC
ENTRYPOINT ["sh","-c","ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && java -jar $JAVA_OPTS /app.jar $PARAMS"]
#!/bin/bash

mkdir xxljob && cd xxljob
vi Dockerfile

apt install -y buildah
buildah login -u ${image_repo_username} --password-stdin < container_password "https://shilintan-registry.cn-shanghai.cr.aliyuncs.com"
buildah build --arch="amd64" --no-cache --format docker -t shilintan-registry.cn-shanghai.cr.aliyuncs.com/public/xxljob:2.4.0-0-amd64 Dockerfile
buildah build --arch="arm64" --no-cache --format docker -t shilintan-registry.cn-shanghai.cr.aliyuncs.com/public/xxljob:2.4.0-0-arm64 Dockerfile
buildah manifest create tmp
buildah manifest add --arch="amd64" tmp shilintan-registry.cn-shanghai.cr.aliyuncs.com/public/xxljob:2.4.0-0-amd64
buildah manifest add --arch="arm64" tmp shilintan-registry.cn-shanghai.cr.aliyuncs.com/public/xxljob:2.4.0-0-arm64
buildah manifest inspect tmp |grep arch
buildah manifest push -f v2s2 --all tmp docker://shilintan-registry.cn-shanghai.cr.aliyuncs.com/public/xxljob:2.4.0-0
buildah manifest push -f v2s2 --all tmp docker://shilintan-registry.cn-shanghai.cr.aliyuncs.com/public/xxljob:2.4.0-0
buildah manifest rm tmp
buildah images
buildah rmi shilintan-registry.cn-shanghai.cr.aliyuncs.com/public/xxljob:2.4.0-0-amd64
buildah rmi shilintan-registry.cn-shanghai.cr.aliyuncs.com/public/xxljob:2.4.0-0-arm64

kubectl delete pod load-generator
kubectl run -it --tty load-generator --image=shilintan-registry.cn-shanghai.cr.aliyuncs.com/public/xxljob:2.4.0-0 -- sh