Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
e2cdb6c7
Commit
e2cdb6c7
authored
Feb 11, 2026
by
yangjianbo
Browse files
feat: 优化build image
parent
f1e884ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
build_image.sh
View file @
e2cdb6c7
#!/
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
}
"
deploy/build_image.sh
View file @
e2cdb6c7
#!/
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
}
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment