feat: 优化build image
This commit is contained in:
@@ -1,8 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
# 本地构建镜像的快速脚本,避免在命令行反复输入构建参数。
|
# 本地构建镜像的快速脚本,避免在命令行反复输入构建参数。
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
docker build -t sub2api:latest \
|
docker build -t sub2api:latest \
|
||||||
--build-arg GOPROXY=https://goproxy.cn,direct \
|
--build-arg GOPROXY=https://goproxy.cn,direct \
|
||||||
--build-arg GOSUMDB=sum.golang.google.cn \
|
--build-arg GOSUMDB=sum.golang.google.cn \
|
||||||
-f Dockerfile \
|
-f "${SCRIPT_DIR}/Dockerfile" \
|
||||||
.
|
"${SCRIPT_DIR}"
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
# 本地构建镜像的快速脚本,避免在命令行反复输入构建参数。
|
# 本地构建镜像的快速脚本,避免在命令行反复输入构建参数。
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||||
|
|
||||||
docker build -t sub2api:latest \
|
docker build -t sub2api:latest \
|
||||||
--build-arg GOPROXY=https://goproxy.cn,direct \
|
--build-arg GOPROXY=https://goproxy.cn,direct \
|
||||||
--build-arg GOSUMDB=sum.golang.google.cn \
|
--build-arg GOSUMDB=sum.golang.google.cn \
|
||||||
-f Dockerfile \
|
-f "${REPO_ROOT}/Dockerfile" \
|
||||||
.
|
"${REPO_ROOT}"
|
||||||
|
|||||||
Reference in New Issue
Block a user