From 17d10795479e0ab9cd8425a1e049f845cbb6e7de Mon Sep 17 00:00:00 2001 From: portdirect Date: Tue, 16 Jan 2018 19:19:17 -0500 Subject: [PATCH] Args: Add distrobution packages to args This PS adds the ability to install arbitary distrobution packages via args, allowing development and deployment helper utilities to be simply included in an image. Change-Id: Id3ce8bceda185978e1d1843072aac44f49b3d95a --- Dockerfile | 1 + README.md | 9 ++++++--- scripts/install_packages.sh | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3953a27..20cfc8d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ ARG PROJECT_REF=master ARG DISTRO ARG PROFILES ARG PIP_PACKAGES="" +ARG DIST_PACKAGES="" ARG PLUGIN=no ARG PYTHON3=no diff --git a/README.md b/README.md index 1cc3966..b14e6fb 100644 --- a/README.md +++ b/README.md @@ -71,9 +71,12 @@ For more advanced building you can use docker build arguments to define: base image. * `PROFILES` The bindep profiles to specify to configure which packages get installed. This is a space sperated list. - * `PIP_PACKAGES` Specify additional packages you would like installed. The - only caveat is these packages must exist in your WHEELS tarball. So if you - wanted to include rpdb, you would need to have built that into your WHEELS. + * `PIP_PACKAGES` Specify additional python packages you would like installed. + The only caveat is these packages must exist in WHEELS form. So if + you wanted to include rpdb, you would need to have built that into your + WHEELS. + * `DIST_PACKAGES` Specify additional distribution packages you would like + installed. 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_packages.sh b/scripts/install_packages.sh index 2b54be7..bc50b8a 100755 --- a/scripts/install_packages.sh +++ b/scripts/install_packages.sh @@ -11,10 +11,10 @@ PACKAGES=($(bindep -f /opt/loci/bindep.txt -b -l newline ${PROJECT} ${PROFILES} if [[ ! -z ${PACKAGES} ]]; then case ${distro} in debian|ubuntu) - apt-get install -y --no-install-recommends ${PACKAGES[@]} + apt-get install -y --no-install-recommends ${PACKAGES[@]} ${DIST_PACKAGES} ;; centos) - yum -y --setopt=skip_missing_names_on_install=False install ${PACKAGES[@]} + yum -y --setopt=skip_missing_names_on_install=False install ${PACKAGES[@]} ${DIST_PACKAGES} ;; *) echo "Unknown distro: ${distro}"