Skip to content

Commit

Permalink
ioc: install user-specified build and runtime tarball packages.
Browse files Browse the repository at this point in the history
This makes it possible to install software not packaged in the
distribution repositories, such as closed-source local packages.
Packages can be installed during the build-stage, since the IOC might
require a given library also at compile time.

`ldconfig` is executed at the end to refresh the dynamic linker library
resolution cache, which is required to identify new libraries installed
with lnls-get-n-unpack. `ldconfig` is not required for the build stage,
as dynamic link will take place only during the binary runtime.
  • Loading branch information
henriquesimoes committed Oct 16, 2023
1 parent 288d0da commit 8f02abc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,23 @@ FROM debian:${DEBIAN_VERSION}-slim AS base
ARG RUNDIR
ARG ENTRYPOINT=/bin/bash
ARG RUNTIME_PACKAGES
ARG RUNTIME_TAR_PACKAGES

RUN apt update -y && \
apt install -y --no-install-recommends \
libreadline8 \
busybox \
netcat-openbsd \
procserv \
wget \
$RUNTIME_PACKAGES && \
apt clean && \
rm -rf /var/lib/apt/lists/*

COPY --from=build-image /usr/local/bin/lnls-get-n-unpack /usr/local/bin/lnls-get-n-unpack
RUN lnls-get-n-unpack -r $RUNTIME_TAR_PACKAGES && \
ldconfig

WORKDIR ${RUNDIR}

RUN ln -s ${ENTRYPOINT} ./entrypoint
Expand All @@ -34,8 +40,10 @@ FROM build-image AS build-stage

ARG REPONAME
ARG BUILD_PACKAGES
ARG BUILD_TAR_PACKAGES

RUN if [ -n "$BUILD_PACKAGES" ]; then apt update && apt install $BUILD_PACKAGES; fi
RUN lnls-get-n-unpack -r $BUILD_TAR_PACKAGES

WORKDIR /opt/${REPONAME}

Expand Down

0 comments on commit 8f02abc

Please sign in to comment.