-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (38 loc) · 1.17 KB
/
Dockerfile
File metadata and controls
49 lines (38 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM quay.io/fedora/python-314:latest AS builder
USER 0
RUN dnf install -y \
git \
gcc \
make \
rust \
cargo \
openssl-devel \
python3-devel \
pkg-config \
&& dnf clean all
WORKDIR /build
COPY . .
RUN pip install --upgrade pip && \
pip install --no-cache-dir setuptools && \
pip install --no-cache-dir --no-binary cryptography cryptography && \
pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir .
RUN ORION_PATH=$(which orion) && \
echo "orion binary: $ORION_PATH" && \
python3 -c "import site; print('site-packages:', site.getsitepackages())" && \
ORION_DIR=$(dirname "$ORION_PATH") && \
mkdir -p "/install${ORION_DIR}" && \
cp "$ORION_PATH" "/install${ORION_PATH}" && \
for sp in $(python3 -c "import site; print(' '.join(site.getsitepackages()))"); do \
if [ -d "$sp" ]; then \
mkdir -p "/install${sp}" && \
cp -r "$sp"/* "/install${sp}/"; \
fi; \
done
FROM quay.io/fedora/python-314:latest
ENV PYTHONUNBUFFERED="1"
USER 0
RUN dnf install -y openssl && dnf clean all
COPY --from=builder /install/ /
USER 1001
ENTRYPOINT ["orion"]