Skip to content
Snippets Groups Projects
Verified Commit 09e5fd1d authored by Stefan Hynek's avatar Stefan Hynek :drooling_face:
Browse files

fix(dockerfile): move pyicu library build to own docker build stage

reduces image size and leaves g++ package behind
parent f3ff6435
No related branches found
No related tags found
1 merge request!16Resolve "move py icu lib build to docker build stage"
Pipeline #278391 passed
...@@ -3,6 +3,14 @@ ...@@ -3,6 +3,14 @@
# SPDX-License-Identifier: CC0-1.0 # SPDX-License-Identifier: CC0-1.0
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
FROM python:3.8-alpine as builder
# build icu lib
# hadolint ignore=DL3018
RUN apk add --no-cache g++ icu-dev \
&& pip install --no-cache-dir PyICU==2.8.1
FROM python:3.8-alpine FROM python:3.8-alpine
LABEL \ LABEL \
...@@ -15,11 +23,14 @@ LABEL \ ...@@ -15,11 +23,14 @@ LABEL \
org.label-schema.vcs-url="https://gitlab.gwdg.de/dariah-de/textgridrep/repdav" \ org.label-schema.vcs-url="https://gitlab.gwdg.de/dariah-de/textgridrep/repdav" \
org.label-schema.vendor="SUB/FE" org.label-schema.vendor="SUB/FE"
# copy pre-compiled icu lib from builder stage
COPY --from=builder /usr/local/lib/python3.8/site-packages/icu /usr/local/lib/python3.8/site-packages/icu
COPY --from=builder /usr/local/lib/python3.8/site-packages/PyICU-2.8.1.dist-info /usr/local/lib/python3.8/site-packages/PyICU-2.8.1.dist-info
# icu-dev package is nevertheless needed by the python library
# hadolint ignore=DL3018 # hadolint ignore=DL3018
RUN adduser -D repdav \ RUN adduser -D repdav \
&& apk add --no-cache \ && apk add --no-cache icu-dev
# currently needed by icu library; needs to be replaced somehow...
g++ icu-dev
USER repdav USER repdav
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment