Skip to content

Commit dc3535f

Browse files
fix(Dockerfile): clean up build arguments and install dependencies (#40)
- Remove unused BUILD_CN argument - Update apt sources conditionally - Install system dependencies in one step Co-authored-by: Haihui.Wang <[email protected]>
1 parent 7cd6208 commit dc3535f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Dockerfile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
ARG PYTHON_IMAGE=docker.io/python:3.10.14
2-
ARG BUILD_CN=false
3-
42
FROM ${PYTHON_IMAGE}
5-
# FROM python:3.10.14
63

74
# prepare the java env
85
WORKDIR /opt
@@ -17,15 +14,16 @@ ENV JAVA_HOME=/opt/jdk
1714

1815
WORKDIR /dataflow
1916

17+
# install 3rd-party system dependencies
18+
# RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 libpq-dev -y
19+
ARG BUILD_CN=false
2020
RUN if [ "$BUILD_CN" = "true" ]; then \
21+
rm -rf /etc/apt/sources.list.d/debian.sources || true; \
2122
echo "deb http://mirrors.aliyun.com/debian bookworm main contrib non-free" > /etc/apt/sources.list; \
2223
echo "deb http://mirrors.aliyun.com/debian-security bookworm-security main contrib non-free" >> /etc/apt/sources.list; \
2324
echo "deb http://mirrors.aliyun.com/debian bookworm-updates main contrib non-free" >> /etc/apt/sources.list; \
24-
fi
25-
26-
# install 3rd-party system dependencies
27-
# RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 libpq-dev -y
28-
RUN apt-get update && \
25+
fi && \
26+
apt-get update && \
2927
apt-get install --no-install-recommends -y \
3028
libpq-dev \
3129
libgl1-mesa-glx \
@@ -58,4 +56,3 @@ RUN git config --global user.email "[email protected]" && \
5856

5957
# Start fastapi API Server
6058
EXPOSE 8000
61-

0 commit comments

Comments
 (0)