Skip to content

Commit a3102b7

Browse files
jouyouyunwzdnzd
authored andcommitted
add arg PIP_INDEX_URL to customize pip index url when build
1 parent c0ef85b commit a3102b7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Dockerfile

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# build: docker buildx build --platform linux/amd64 -f Dockerfile -t wzdnzd/aggregator:tag .
1+
# build: docker buildx build --platform linux/amd64 -f Dockerfile -t wzdnzd/aggregator:tag --build-arg PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple" .
22

33
FROM python:3.12.3-slim
44

5-
MAINTAINER wzdnzd
5+
LABEL maintainer="wzdnzd"
66

77
# github personal access token
88
ENV GIST_PAT=""
@@ -13,6 +13,9 @@ ENV GIST_LINK=""
1313
# customize airport listing url address
1414
ENV CUSTOMIZE_LINK=""
1515

16+
# pip default index url
17+
ARG PIP_INDEX_URL="https://pypi.org/simple"
18+
1619
WORKDIR /aggregator
1720

1821
# copy files, only linux related files are needed
@@ -27,7 +30,7 @@ RUN rm -rf subconverter/subconverter-darwin-amd \
2730
&& rm -rf subconverter/subconverter-windows.exe
2831

2932
# install dependencies
30-
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --no-cache-dir -r requirements.txt
33+
RUN pip install -i ${PIP_INDEX_URL} --no-cache-dir -r requirements.txt
3134

3235
# start and run
33-
CMD ["python", "-u", "subscribe/collect.py", "--all", "--overwrite", "--skip"]
36+
CMD ["python", "-u", "subscribe/collect.py", "--all", "--overwrite", "--skip"]

0 commit comments

Comments
 (0)