diff --git a/defaults/main.yml b/defaults/main.yml index c94ccb4..228f9c0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -36,6 +36,11 @@ nextcloud_customized_container_src_path: "{{ nextcloud_base_path }}/customized-c nextcloud_container_image_customizations_php_imageick_installation_enabled: false nextcloud_container_image_customizations_php_imageick_installation_package: "libmagickcore-6.q16-6-extra" +# Samba (SMB) support for Windows fileshares can be setup using the toggle below, which +# installs the smbclient package per the example here https://github.com/nextcloud/docker/blob/master/.examples/dockerfiles/smb/apache/Dockerfile +# Also see ../../templates/customizations/Dockerfile.j2 +nextcloud_container_image_customizations_samba_enabled: false + # Preview generator setup # # Enable the variable nextcloud_preview_enabled and you are good to go. @@ -90,7 +95,14 @@ nextcloud_preview_app_jpeg_quality: "60" # - `nextcloud_container_image_customizations_dockerfile_body_custom` # - `nextcloud_container_image_customized` # - `nextcloud_container_image_final` -nextcloud_container_image_customizations_enabled: "{{ nextcloud_container_image_customizations_php_imageick_installation_enabled }}" +nextcloud_container_image_customizations_enabled: | + {{ + ( + nextcloud_container_image_customizations_php_imageick_installation_enabled + or + nextcloud_container_image_customizations_samba_enabled + ) + }} # nextcloud_container_image_customizations_dockerfile_body_custom contains your custom Dockerfile steps # for building your customized Nextcloud image based on the original (upstream) image (`nextcloud_container_image`). diff --git a/templates/customizations/Dockerfile.j2 b/templates/customizations/Dockerfile.j2 index b60a5f4..a57ff36 100644 --- a/templates/customizations/Dockerfile.j2 +++ b/templates/customizations/Dockerfile.j2 @@ -1,8 +1,17 @@ FROM {{ nextcloud_container_image }} +{% set packages_to_install = [] %} + {% if nextcloud_container_image_customizations_php_imageick_installation_enabled %} -RUN apt -y update -RUN apt -y install {{ nextcloud_container_image_customizations_php_imageick_installation_package }} +{% set packages_to_install = packages_to_install + [nextcloud_container_image_customizations_php_imageick_installation_package] %} +{% endif %} + +{% if nextcloud_container_image_customizations_samba_enabled %} +{% set packages_to_install = packages_to_install + ['procps', 'smbclient'] %} +{% endif %} + +{% if packages_to_install | length > 0 %} +RUN apt -y update && apt -y install {{ packages_to_install | join(' ') }} && rm -rf /var/lib/apt/lists/* {% endif %} {{ nextcloud_container_image_customizations_dockerfile_body_custom }}