1
0
Fork 0

add samba customization to dockerfile, if nextcloud_container_image_customizations_samba_enabled: true (#12)

* Update main.yml

set container customizations to enabled if nextcloud_container_image_smb_enabled is set (OR imagemagick)

* nextcloud_container_image_customizations_smb_enabled activates customizations

* add smbclient installation to docker image, if enabled

see https://github.com/nextcloud/docker/blob/master/.examples/dockerfiles/smb/apache/Dockerfile for source

* Set variable default and revise multiline syntax

Integrate suggestions from @spantaleev

* Refactor code to make only a single, one-line package install

Per suggestion @spanteleev;  so that extra files can be deleted without leaving a footprint in the stack of images
This commit is contained in:
brush 2023-12-03 02:25:26 -08:00 committed by GitHub
parent c97d928215
commit 738ab37716
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 3 deletions

View file

@ -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_enabled: false
nextcloud_container_image_customizations_php_imageick_installation_package: "libmagickcore-6.q16-6-extra" 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 # Preview generator setup
# #
# Enable the variable nextcloud_preview_enabled and you are good to go. # 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_customizations_dockerfile_body_custom`
# - `nextcloud_container_image_customized` # - `nextcloud_container_image_customized`
# - `nextcloud_container_image_final` # - `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 # 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`). # for building your customized Nextcloud image based on the original (upstream) image (`nextcloud_container_image`).

View file

@ -1,8 +1,17 @@
FROM {{ nextcloud_container_image }} FROM {{ nextcloud_container_image }}
{% set packages_to_install = [] %}
{% if nextcloud_container_image_customizations_php_imageick_installation_enabled %} {% if nextcloud_container_image_customizations_php_imageick_installation_enabled %}
RUN apt -y update {% set packages_to_install = packages_to_install + [nextcloud_container_image_customizations_php_imageick_installation_package] %}
RUN apt -y 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 %} {% endif %}
{{ nextcloud_container_image_customizations_dockerfile_body_custom }} {{ nextcloud_container_image_customizations_dockerfile_body_custom }}