Skip to content

Commit

Permalink
改用alpine老镜像
Browse files Browse the repository at this point in the history
  • Loading branch information
ryjer committed Sep 16, 2023
1 parent 64c7c37 commit 505e9d7
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
push:
#branches: [ master ]
paths:
- Dockerfile
- Dockerfile.default
pull_request:
branches: [ master ]

Expand Down Expand Up @@ -51,15 +51,16 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
file: Dockerfile.default
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
tags: |
ryjer/opentracker:latest
ryjer/opentracker:alpine3.18
ryjer/opentracker:alpine3.18.3
ryjer/opentracker:alpine
ryjer/opentracker:alpine3.15
ryjer/opentracker:alpine3.15.10
# 处理缓存无限增大问题的临时修复,以防出现问题。(等待github官方修复)
#- name: Move cache
Expand Down
43 changes: 43 additions & 0 deletions Dockerfile.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM alpine:3.15.10 as build

WORKDIR /src
RUN apk add gcc \
g++ \
make \
git \
cvs \
zlib-dev

# 下载并编译 libowfat 库
RUN cvs -d :pserver:[email protected]:/cvs -z9 co libowfat \
&& cd libowfat \
&& make

RUN git clone git://erdgeist.org/opentracker \
&& cd opentracker \
&& make clean && make


FROM alpine:3.15.10

# XDG目录规范
ENV XDG_CONFIG_HOME=/config

COPY --from=build /src/opentracker/opentracker /bin/opentracker

# 创建配置目录,安装 curl 健康检查使用
RUN apk add --no-cache curl \
&& mkdir -p /config

# 对外暴露配置卷路径
VOLUME /config

# 复制配置文件到配置路径
COPY ./opentracker.conf /config/opentracker.conf
COPY ./whitelist /config/whitelist
COPY ./blacklist /config/blacklist

EXPOSE 6969/tcp
EXPOSE 6969/udp

CMD /bin/opentracker -f /config/opentracker.conf

0 comments on commit 505e9d7

Please sign in to comment.