Add support for installing arbitrary packages in the customized container image
Related to https://github.com/mother-of-all-self-hosting/ansible-role-nextcloud/pull/12
This commit is contained in:
parent
c3d5f18024
commit
3c18ed01f2
3 changed files with 26 additions and 13 deletions
|
@ -87,6 +87,8 @@ nextcloud_container_image_customizations_enabled: |
|
||||||
nextcloud_container_image_customizations_php_imageick_installation_enabled
|
nextcloud_container_image_customizations_php_imageick_installation_enabled
|
||||||
or
|
or
|
||||||
nextcloud_container_image_customizations_samba_enabled
|
nextcloud_container_image_customizations_samba_enabled
|
||||||
|
or
|
||||||
|
nextcloud_container_image_customizations_packages_to_install | length > 0
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
@ -97,12 +99,24 @@ nextcloud_container_image_customizations_enabled: |
|
||||||
# https://github.com/nextcloud/server/issues/13099
|
# https://github.com/nextcloud/server/issues/13099
|
||||||
# Tread wisely!
|
# Tread wisely!
|
||||||
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_packages: ['libmagickcore-6.q16-6-extra']
|
||||||
|
|
||||||
# Samba (SMB) support for Windows fileshares can be setup using the toggle below, which
|
# 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
|
# 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
|
# Also see ../../templates/customizations/Dockerfile.j2
|
||||||
nextcloud_container_image_customizations_samba_enabled: false
|
nextcloud_container_image_customizations_samba_enabled: false
|
||||||
|
nextcloud_container_image_customizations_samba_packages: ['procps', 'smbclient']
|
||||||
|
|
||||||
|
# A list of packages to install in the customized Nextcloud container image.
|
||||||
|
# To add your own, use `nextcloud_container_image_customizations_packages_to_install_custom`
|
||||||
|
nextcloud_container_image_customizations_packages_to_install: "{{ (nextcloud_container_image_customizations_packages_to_install_auto + nextcloud_container_image_customizations_packages_to_install_custom) | unique }}"
|
||||||
|
nextcloud_container_image_customizations_packages_to_install_auto: |
|
||||||
|
{{
|
||||||
|
(nextcloud_container_image_customizations_php_imageick_installation_packages if nextcloud_container_image_customizations_php_imageick_installation_enabled else [])
|
||||||
|
+
|
||||||
|
(nextcloud_container_image_customizations_samba_packages if nextcloud_container_image_customizations_samba_enabled else [])
|
||||||
|
}}
|
||||||
|
nextcloud_container_image_customizations_packages_to_install_custom: []
|
||||||
|
|
||||||
# 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`).
|
||||||
|
|
|
@ -14,6 +14,15 @@
|
||||||
- nextcloud_database_username
|
- nextcloud_database_username
|
||||||
- nextcloud_database_password
|
- nextcloud_database_password
|
||||||
|
|
||||||
|
- name: (Deprecation) Catch and report renamed Nextcloud variables
|
||||||
|
ansible.builtin.fail:
|
||||||
|
msg: >-
|
||||||
|
Your configuration contains a variable, which now has a different name.
|
||||||
|
Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
|
||||||
|
when: "vars | dict2items | selectattr('key', 'match', item.old) | list | items2dict"
|
||||||
|
with_items:
|
||||||
|
- {'old': 'nextcloud_container_image_customizations_php_imageick_installation_package', 'new': '<superseded by nextcloud_container_image_customizations_php_imageick_installation_packages>'}
|
||||||
|
|
||||||
- when: nextcloud_container_labels_traefik_enabled | bool
|
- when: nextcloud_container_labels_traefik_enabled | bool
|
||||||
block:
|
block:
|
||||||
- name: Fail if required Nextcloud Traefik settings not defined
|
- name: Fail if required Nextcloud Traefik settings not defined
|
||||||
|
|
|
@ -1,17 +1,7 @@
|
||||||
FROM {{ nextcloud_container_image }}
|
FROM {{ nextcloud_container_image }}
|
||||||
|
|
||||||
{% set packages_to_install = [] %}
|
{% if nextcloud_container_image_customizations_packages_to_install | length > 0 %}
|
||||||
|
RUN apt -y update && apt -y install {{ nextcloud_container_image_customizations_packages_to_install | join(' ') }} && rm -rf /var/lib/apt/lists/*
|
||||||
{% if nextcloud_container_image_customizations_php_imageick_installation_enabled %}
|
|
||||||
{% 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 %}
|
{% endif %}
|
||||||
|
|
||||||
{{ nextcloud_container_image_customizations_dockerfile_body_custom }}
|
{{ nextcloud_container_image_customizations_dockerfile_body_custom }}
|
||||||
|
|
Loading…
Reference in a new issue