-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b9c1a2
commit 748edda
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM cr.loongnix.cn/alpine:3.11 as builder | ||
|
||
RUN apk update \ | ||
&& apk add wget \ | ||
&& wget https://github.com/Loongson-Cloud-Community/one-api/releases/download/v0.6.7/one-api -O /one-api \ | ||
&& chmod +x /one-api | ||
|
||
|
||
FROM cr.loongnix.cn/alpine:3.11 | ||
|
||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add --no-cache ca-certificates tzdata \ | ||
&& update-ca-certificates 2>/dev/null || true | ||
|
||
COPY --from=builder /one-api / | ||
EXPOSE 3000 | ||
WORKDIR /data | ||
ENTRYPOINT ["/one-api"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This file is generated by the template. | ||
|
||
REGISTRY?=cr.loongnix.cn | ||
ORGANIZATION?=songquanpeng | ||
REPOSITORY?=one-api | ||
TAG?=0.6.7 | ||
LATEST?=true | ||
|
||
IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) | ||
LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest | ||
|
||
default: image | ||
|
||
image: | ||
docker build \ | ||
--build-arg http_proxy=$(http_proxy) \ | ||
--build-arg https_proxy=$(https_proxy) \ | ||
-t $(IMAGE) \ | ||
. | ||
|
||
push: | ||
docker push $(IMAGE) | ||
#latest image | ||
@if [ $(LATEST) = "true" ]; \ | ||
then \ | ||
docker tag $(IMAGE) $(LATEST_IMAGE); \ | ||
docker push $(LATEST_IMAGE); \ | ||
fi |