diff --git a/.github/workflows/BuildImage.yml b/.github/workflows/BuildImage.yml index 518b0d8..b3fd190 100644 --- a/.github/workflows/BuildImage.yml +++ b/.github/workflows/BuildImage.yml @@ -4,8 +4,8 @@ on: [push, pull_request, workflow_dispatch] env: ENDPOINT: "linuxserver/mods" #don't modify - BASEIMAGE: "replace_baseimage" #replace - MODNAME: "replace_modname" #replace + BASEIMAGE: "universal" #replace + MODNAME: "package-install" #replace jobs: build: diff --git a/README.md b/README.md index 45da1f4..2cda1b1 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# APT Install - Universal Docker mod +# Package Install - Universal Docker mod -Using this mod you can install any package during starup by providing it through the environment variable `APT_PACKAGES`. This is then passed into the installation command as such: `apt install -y --no-install-recommends ${APT_PACKAGES}`. +Using this mod you can install any package during starup by providing it through the environment variable `INSTALL_PACKAGES`. This is then passed into the installation command as such: `apt install -y --no-install-recommends ${INSTALL_PACKAGES}` or `apk add --no-cache ${INSTALL_PACKAGES}` for Alpine based images. -In any docker container arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:universal-apt-install` +In any docker container arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:universal-package-install` -If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:universal-apt-install|linuxserver/mods:universal-stdout-logs` +If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:universal-package-install|linuxserver/mods:universal-stdout-logs` For example, to install `rsync`, `git` and `nginx` add the following lines to your docker compose service: ```yaml -- DOCKER_MODS=linuxserver/mods:universal-apt-install -- APT_PACKAGES=rsync git nginx +- DOCKER_MODS=linuxserver/mods:universal-package-install +- INSTALL_PACKAGES=rsync git nginx ``` diff --git a/root/etc/cont-init.d/97-apt-install b/root/etc/cont-init.d/97-apt-install deleted file mode 100644 index 52272bb..0000000 --- a/root/etc/cont-init.d/97-apt-install +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/with-contenv bash - -# Exit if no installable packages are provided -if [ -z ${APT_PACKAGES+x} ]; then - echo "**** No APT packages to install ****" - exit 0 -fi - -if [ -f /usr/bin/apt ]; then - apt install -y --no-install-recommends ${APT_PACKAGES} -else - echo "!!! apt not found !!!" -fi diff --git a/root/etc/cont-init.d/97-install-packages b/root/etc/cont-init.d/97-install-packages new file mode 100644 index 0000000..288e816 --- /dev/null +++ b/root/etc/cont-init.d/97-install-packages @@ -0,0 +1,17 @@ +#!/usr/bin/with-contenv bash + +# Exit if no installable packages are provided +if [ -z ${INSTALL_PACKAGES+x} ]; then + echo "**** No packages to install ****" + exit 0 +fi + +# Ubuntu +if [ -f /usr/bin/apt ]; then + apt install -y --no-install-recommends ${INSTALL_PACKAGES} +fi + +# Alpine +if [ -f /sbin/apk ]; then + apk add --no-cache ${INSTALL_PACKAGES} +fi \ No newline at end of file