Initial updates server repository commit.
Reinitialize repository history and exclude generated OTA artifact outputs. Made-with: Cursor
This commit is contained in:
19
build-docker-tar.sh
Executable file
19
build-docker-tar.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
TAG=${1:-$(date +%Y%m%d-%H%M%S)}
|
||||
IMAGE="carrot-bbs-updates-server:${TAG}"
|
||||
TAR_NAME="carrot-bbs-updates-server-${TAG}.tar"
|
||||
|
||||
echo "[1/3] 构建 Linux 二进制..."
|
||||
go build -o server ./cmd/server
|
||||
|
||||
echo "[2/3] 构建 Docker 镜像: ${IMAGE}"
|
||||
docker build -t "${IMAGE}" .
|
||||
|
||||
echo "[3/3] 导出镜像 tar: ${TAR_NAME}"
|
||||
docker save -o "${TAR_NAME}" "${IMAGE}"
|
||||
|
||||
echo "完成:"
|
||||
echo " 镜像: ${IMAGE}"
|
||||
echo " 归档: $(pwd)/${TAR_NAME}"
|
||||
Reference in New Issue
Block a user