FROM mambaorg/micromamba:2.0.5
RUN MAMBA_EXTRACT_THREADS=1 micromamba install -y -n base -c conda-forge -c bioconda --strict-channel-priority "bioconda::lrsim=1.0" \
 && micromamba clean -afy
ENV PATH=/opt/conda/bin:$PATH LANG=C.UTF-8 PERL_INLINE_DIRECTORY=/opt/inline
# perl 5.32 headers want xlocale.h, which the conda sysroot (glibc 2.34) no longer ships;
# the Inline::C code in lrsim is compiled once here so the runtime container needs no compiler
USER root
RUN echo '#include <locale.h>' > /opt/conda/x86_64-conda-linux-gnu/sysroot/usr/include/xlocale.h \
 && mkdir -p /opt/inline && (lrsim 2>&1 | tail -5 || true) \
 && ls /opt/inline/lib/auto/* && chmod -R a+rX /opt/inline
USER 65534:65534
WORKDIR /work/out
ENTRYPOINT []
