Skip to content

Commit ad7ad50

Browse files
committed
fix(passport): error loading shared library
1 parent 1193a19 commit ad7ad50

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

rootfs/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ WORKDIR /app
66
RUN npm install \
77
&& yarn build
88

9-
109
FROM docker.io/library/python:3.9-alpine
1110

1211
COPY requirements.txt /app/requirements.txt
1312

14-
ENV PATH="/app/.venv/bin:${PATH}"
15-
1613
RUN apk add --update --virtual .build-deps \
1714
postgresql-dev \
1815
gcc \
@@ -23,12 +20,13 @@ RUN apk add --update --virtual .build-deps \
2320
cargo \
2421
rust \
2522
&& python3 -m venv /app/.venv \
23+
&& source /app/.venv/bin/activate \
2624
&& pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt \
2725
&& runDeps="$( \
28-
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
26+
scanelf --needed --nobanner --format '%n#p' --recursive /app/.venv \
2927
| tr ',' '\n' \
3028
| sort -u \
31-
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
29+
| awk 'system("[ -e /app/.venv/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
3230
)" \
3331
&& apk add --update --virtual .passport-rundeps \
3432
$runDeps \
@@ -41,6 +39,8 @@ RUN apk add --update --virtual .build-deps \
4139
COPY . /app
4240
COPY --from=build-app /app/dist /app/web/dist
4341

42+
ENTRYPOINT ["/app/bin/entrypoint"]
43+
4444
WORKDIR /app
4545
CMD ["/app/bin/boot"]
4646
EXPOSE 8000

rootfs/Dockerfile.test

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/testing >>/etc/apk/repositor
1818
cargo \
1919
rust \
2020
&& python3 -m venv /app/.venv \
21+
&& source /app/.venv/bin/activate \
2122
&& pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt \
2223
&& pip3 install --disable-pip-version-check --no-cache-dir -r /app/dev_requirements.txt \
2324
&& runDeps="$( \
24-
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
25+
scanelf --needed --nobanner --format '%n#p' --recursive /app/.venv \
2526
| tr ',' '\n' \
2627
| sort -u \
27-
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
28+
| awk 'system("[ -e /app/.venv/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
2829
)" \
2930
&& apk add --update --virtual .passport-rundeps \
3031
$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)