Skip to content

Commit 47d438d

Browse files
committed
fix(controller): error loading shared library
1 parent ba0b69d commit 47d438d

3 files changed

Lines changed: 19 additions & 9 deletions

File tree

rootfs/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,22 @@ FROM docker.io/library/python:3.9-alpine
22

33
COPY requirements.txt /app/requirements.txt
44

5-
ENV PATH="/app/.venv/bin:${PATH}"
6-
75
RUN apk add --update --virtual .build-deps \
8-
postgresql-dev \
96
gcc \
107
rust \
118
cargo \
9+
postgresql-dev \
1210
libffi-dev \
1311
musl-dev \
1412
openssl-dev \
1513
&& python3 -m venv /app/.venv \
14+
&& source /app/.venv/bin/activate \
1615
&& pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt \
1716
&& runDeps="$( \
18-
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
17+
scanelf --needed --nobanner --format '%n#p' --recursive /app/.venv \
1918
| tr ',' '\n' \
2019
| sort -u \
21-
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
20+
| awk 'system("[ -e /app/.venv/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
2221
)" \
2322
&& apk add --update --virtual .controller-rundeps \
2423
$runDeps \
@@ -30,6 +29,8 @@ RUN apk add --update --virtual .build-deps \
3029

3130
COPY . /app
3231

32+
ENTRYPOINT ["/app/bin/entrypoint"]
33+
3334
WORKDIR /app
3435
CMD ["/app/bin/boot"]
3536
EXPOSE 8000

rootfs/Dockerfile.test

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,22 @@ ENV PATH="/app/.venv/bin:${PATH}"
99

1010
RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/testing >>/etc/apk/repositories \
1111
&& apk add --update --virtual .build-deps \
12-
postgresql-dev \
1312
gcc \
1413
rust \
1514
cargo \
15+
postgresql-dev \
1616
libffi-dev \
1717
musl-dev \
18-
openldap-dev \
18+
openssl-dev \
1919
&& python3 -m venv /app/.venv \
20+
&& source /app/.venv/bin/activate \
2021
&& pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt \
2122
&& pip3 install --disable-pip-version-check --no-cache-dir -r /app/dev_requirements.txt \
2223
&& runDeps="$( \
23-
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
24+
scanelf --needed --nobanner --format '%n#p' --recursive /app/.venv \
2425
| tr ',' '\n' \
2526
| sort -u \
26-
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
27+
| awk 'system("[ -e /app/.venv/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
2728
)" \
2829
&& apk add --update --virtual .controller-rundeps \
2930
$runDeps \
@@ -43,6 +44,8 @@ RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/testing >>/etc/apk/repositor
4344

4445
COPY . /app
4546

47+
ENTRYPOINT ["/app/bin/entrypoint"]
48+
4649
WORKDIR /app
4750
CMD ["/app/bin/boot"]
4851
EXPOSE 8000

rootfs/bin/entrypoint

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
# shellcheck disable=SC1090,SC1091
3+
4+
set -e
5+
source /app/.venv/bin/activate
6+
exec "$@"

0 commit comments

Comments
 (0)