Fetch the repository succeeded.
This action will force synchronization from 陈钇蒙/nginxWebUI, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
#!/usr/bin/env bash
## 需要安装好docker,并登陆docker login
## 需要安装好docker-buildx:https://docs.docker.com/engine/install/ubuntu/
## 如需自动推送readme至dockerhub,需要安装docker-pushrm:https://github.com/christian-korneck/docker-pushrm
## Dockerfile同目录下运行此脚本
## 如果在同目录下存在maven的镜像加速配置文件settings.xml,也会作为编译时的加速配置
set -o pipefail
## 基本信息
repo="cym1102/nginxwebui"
arch="linux/386,linux/amd64,linux/arm64,linux/arm/v7"
ver=$(cat pom.xml | grep -A1 nginxWebUI | grep version | grep -oP "\d+\.\d+\.\d+")
echo "构建镜像:$repo"
echo "构建架构:$arch"
echo "构建版本:$ver"
## 编译jar文件
echo "3秒后开始编译jar文件..."
sleep 3
mvn clean package
## 准备跨平台构建环境
echo "准备跨平台构建环境"
docker pull tonistiigi/binfmt
docker run --privileged --rm tonistiigi/binfmt --install all
docker buildx create --name builder --use 2>/dev/null || docker buildx use builder
docker buildx inspect --bootstrap
## 多平台镜像同时构建并推送
echo "构建镜像并推送至Docker Hub"
docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--platform "$arch" \
--tag ${repo}:${ver} \
--tag ${repo}:latest \
--push \
.
## 推送readme.md至dockerhub,需要docker-pushrm
# docker pushrm $repo
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。