From 13fe440e4b1094e44c0121f2a297e34dd0911dc6 Mon Sep 17 00:00:00 2001 From: QXYang686 Date: Sat, 14 Feb 2026 20:22:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=84=E5=BB=BA=E8=84=9A=E6=9C=AC=E5=87=86?= =?UTF-8?q?=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sh | 30 ++++++++++++++++++++++++++++++ system-setup.sh | 21 +++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 build.sh create mode 100644 system-setup.sh diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..f11af09 --- /dev/null +++ b/build.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +export REGISTRY=registry.yqxpro.com + +pushd common-base +npx devcontainer build \ + --platform linux/amd64,linux/arm64 \ + --image-name ${REGISTRY}/devcontainers/common-base \ + --cache-to type=registry,ref=${REGISTRY}/devcontainers/common-base:buildcache,mode=max \ + --cache-from type=registry,ref=${REGISTRY}/devcontainers/common-base:buildcache && \ + docker push ${REGISTRY}/devcontainers/common-base &&\ +popd + +pushd develop-base +npx devcontainer build \ + --platform linux/amd64,linux/arm64 \ + --image-name ${REGISTRY}/devcontainers/develop-base \ + --cache-to type=local,ref=${REGISTRY}/devcontainers/develop-base,mode=max \ + --cache-from type=local,ref=${REGISTRY}/devcontainers/develop-base && \ + docker push ${REGISTRY}/devcontainers/develop-base &&\ +popd + +pushd universal-base +npx devcontainer build \ + --platform linux/amd64,linux/arm64 \ + --image-name ${REGISTRY}/devcontainers/universal-base \ + --cache-to type=local,dest=${HOME}/docker-buildcache/devcontainers/universal-base,mode=max \ + --cache-from type=local,src=${HOME}/docker-buildcache/devcontainers/universal-base && \ + docker push ${REGISTRY}/devcontainers/universal-base &&\ +popd diff --git a/system-setup.sh b/system-setup.sh new file mode 100644 index 0000000..6fb1728 --- /dev/null +++ b/system-setup.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +sudo apt update +sudo apt install -y npm git +curl -fsSL https://raw.githubusercontent.com/docker/docker-install/master/install.sh | sh +sudo usermod -aG docker $USER +docker buildx create --use --name multiarch-builder + +docker run -d \ + --restart=always \ + --name registry \ + -v "$(pwd)"/certs:/certs \ + -e REGISTRY_HTTP_ADDR=0.0.0.0:443 \ + -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/registry.yqxpro.com.crt \ + -e REGISTRY_HTTP_TLS_KEY=/certs/registry.yqxpro.com.key \ + -p 443:443 \ + registry:3 + +git clone https://gitea.yqxpro.com/QXYang686/devcontainers.git +cd devcontainers +npm install