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
4826fe9b
Commit
4826fe9b
authored
Apr 08, 2026
by
道非仙
Browse files
fix(docker): update Dockerfile to use specific harbor images and modify apk repository
parent
fb233463
Pipeline
#81984
failed
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
0 → 100644
View file @
4826fe9b
stages
:
-
build
-
deploy
default
:
tags
:
-
devops-runner
image
:
docker:latest
services
:
-
docker:dind
variables
:
HARBOR_SERVICE
:
"
harbor.linkfog.cn"
HARBOR_REGISTRY
:
"
sub2api"
HARBOR_USERNAME
:
"
public"
HARBOR_PASSWORD
:
"
LinkfogHarbor2024@"
VERSION
:
"
"
COMMIT
:
"
"
DATE
:
"
"
workflow
:
rules
:
-
if
:
$CI_COMMIT_TAG
when
:
always
.docker-build-push-template
:
&docker-build-push-template
script
:
-
set -eo pipefail
-
echo "DEBUG----- $(date '+%Y-%m-%d %H:%M:%S') Starting build process"
-
>
if [ -n "$CI_COMMIT_TAG" ]; then
IMAGE_TAG="${CI_COMMIT_TAG#sub2api/}";
else
IMAGE_TAG="${CI_COMMIT_REF_NAME}";
fi
-
echo "Image tag
:
$IMAGE_TAG"
-
echo "Logging into Harbor..."
-
echo "$HARBOR_PASSWORD" | docker login -u "$HARBOR_USERNAME" --password-stdin "$HARBOR_SERVICE"
-
docker build -f Dockerfile --build-arg VERSION="${VERSION}" --build-arg COMMIT="${COMMIT}" --build-arg DATE="${DATE}" -t "$HARBOR_SERVICE/$HARBOR_REGISTRY/sub2api:$IMAGE_TAG" .
-
docker push "$HARBOR_SERVICE/$HARBOR_REGISTRY/sub2api:$IMAGE_TAG"
-
docker rmi "$HARBOR_SERVICE/$HARBOR_REGISTRY/sub2api:$IMAGE_TAG" ||
true
sub2api
:
stage
:
build
<<
:
*docker-build-push-template
variables
:
VERSION
:
"
${CI_COMMIT_TAG:-}"
COMMIT
:
"
${CI_COMMIT_SHA}"
DATE
:
"
$(date
-u
+%Y-%m-%dT%H:%M:%SZ)"
rules
:
-
if
:
$CI_COMMIT_TAG =~ /^sub2api\/v/
when
:
always
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when
:
always
Dockerfile
View file @
4826fe9b
...
...
@@ -6,10 +6,10 @@
# Stage 3: Final minimal image
# =============================================================================
ARG
NODE_IMAGE=node:24-alpine
ARG
GOLANG_IMAGE=golang:1.26.1-alpine
ARG
ALPINE_IMAGE=alpine:3.21
ARG
POSTGRES_IMAGE=postgres:18-alpine
ARG
NODE_IMAGE=
harbor.linkfog.cn/library/
node:24-alpine
ARG
GOLANG_IMAGE=
harbor.linkfog.cn/library/
golang:1.26.1-alpine
ARG
ALPINE_IMAGE=
harbor.linkfog.cn/library/
alpine:3.21
ARG
POSTGRES_IMAGE=
harbor.linkfog.cn/library/
postgres:18-alpine
ARG
GOPROXY=https://goproxy.cn,direct
ARG
GOSUMDB=sum.golang.google.cn
...
...
@@ -89,7 +89,9 @@ LABEL description="Sub2API - AI API Gateway Platform"
LABEL
org.opencontainers.image.source="https://github.com/Wei-Shaw/sub2api"
# Install runtime dependencies
RUN
apk add
--no-cache
\
RUN
sed
-i
's|dl-cdn.alpinelinux.org|mirrors.aliyun.com|g'
/etc/apk/repositories
&&
\
apk update
&&
\
apk add
--no-cache
\
ca-certificates
\
tzdata
\
su-exec
\
...
...
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