diff --git a/Dockerfile b/Dockerfile index 256046f..b151e4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,8 @@ ARG PIP_ARGS="" ARG DIST_PACKAGES="" ARG PLUGIN=no ARG PYTHON3=no +ARG EXTRA_BINDEP="" +ARG EXTRA_PYDEP="" ARG UID=42424 ARG GID=42424 @@ -23,6 +25,6 @@ ARG SPICE_REPO=https://gitlab.freedesktop.org/spice/spice-html5.git ARG SPICE_REF=spice-html5-0.1.6 COPY scripts /opt/loci/scripts -COPY bindep.txt pydep.txt /opt/loci/ +ADD bindep.txt pydep.txt $EXTRA_BINDEP $EXTRA_PYDEP /opt/loci/ RUN /opt/loci/scripts/install.sh diff --git a/README.md b/README.md index 00466ac..4dc5d15 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,10 @@ For more advanced building you can use docker build arguments to define: * `PIP_ARGS` Specify additional pip's parameters you would like. * `DIST_PACKAGES` Specify additional distribution packages you would like installed. + * `EXTRA_BINDEP` Specify a bindep-* file to add in the container. It would + be considered next to the default bindep.txt. + * `EXTRA_PYDEP` Specify a pydep-* file to add in the container. It would + be considered next to the default pydep.txt. This makes it really easy to integrate LOCI images into your development or CI/CD workflow, for example, if you wanted to build an image from [this diff --git a/scripts/install.sh b/scripts/install.sh index ee0591e..eee1fc3 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -78,8 +78,10 @@ if [[ "${PLUGIN}" == "no" ]]; then $(dirname $0)/create_user.sh $(dirname $0)/setup_pip.sh $(dirname $0)/pip_install.sh bindep - PACKAGES=($(bindep -f /opt/loci/pydep.txt -b -l newline ${PROJECT} ${PROFILES} ${python3} || :)) - $(dirname $0)/pip_install.sh ${PACKAGES[@]} + for file in /opt/loci/pydep*; do + PYDEP_PACKAGES+=($(bindep -f $file -b -l newline ${PROJECT} ${PROFILES} ${python3} || :)) + done + $(dirname $0)/pip_install.sh ${PYDEP_PACKAGES[@]} fi if [[ ${PROJECT} == 'nova' ]]; then diff --git a/scripts/install_packages.sh b/scripts/install_packages.sh index fba3f5d..1ff0282 100755 --- a/scripts/install_packages.sh +++ b/scripts/install_packages.sh @@ -6,7 +6,9 @@ if [[ "${PYTHON3}" != "no" ]]; then python3=python3 fi -PACKAGES=($(bindep -f /opt/loci/bindep.txt -b -l newline ${PROJECT} ${PROFILES} ${python3} || :)) +for file in /opt/loci/bindep*; do + PACKAGES+=($(bindep -f $file -b -l newline ${PROJECT} ${PROFILES} ${python3} || :)) +done if [[ ! -z ${PACKAGES} ]]; then case ${distro} in