Skip to content

Commit 3e3c398

Browse files
committed
build(Dockerfile): use multistage build
1 parent 3b3db01 commit 3e3c398

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Dockerfile

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM python:3.10-alpine
4-
3+
FROM python:3.11-alpine AS builder
54
LABEL org.opencontainers.image.authors="[email protected]"
6-
75
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
86
RUN apk update
97
RUN apk add git
10-
8+
WORKDIR /app
119
RUN git clone https://github.com/WangYihang/GitHacker.git
12-
RUN cd GitHacker && pip install -r requirements.txt && python setup.py install
10+
RUN cd GitHacker && pip install -r requirements.txt && python setup.py sdist bdist_wheel
11+
12+
FROM python:3.11-alpine
13+
COPY --from=builder /app/GitHacker/dist/ /app/
14+
RUN pip install /app/*.whl
15+
ENV GIT_PYTHON_REFRESH=quiet
1316

1417
ENTRYPOINT ["githacker"]

0 commit comments

Comments
 (0)