diff --git a/template/xwiki/docker-entrypoint.sh b/template/xwiki/docker-entrypoint.sh
index d912a5073eaecf7e028b7de2132123d0e949c51b..5568830c49f77c73d39b6b8f213f33d2b7c9ace6 100755
--- a/template/xwiki/docker-entrypoint.sh
+++ b/template/xwiki/docker-entrypoint.sh
@@ -92,9 +92,13 @@ function configure() {
   echo '  Using filesystem-based attachments...'
   xwiki_set_cfg 'xwiki.store.attachment.hint' 'file'
   xwiki_set_cfg 'xwiki.store.attachment.versioning.hint' 'file'
-  xwiki_set_cfg 'xwiki.store.attachment.recyclebin.content.hint' 'file'
+<% if (xwikiVersion.startsWith('8.'))
+print '''  xwiki_set_cfg 'xwiki.store.attachment.recyclebin.hint' 'file'
+'''
+else if (xwikiVersion.startsWith('9.'))print '''  xwiki_set_cfg 'xwiki.store.attachment.recyclebin.content.hint' 'file'
   echo '  Using filesystem-based deleted documents...'
   xwiki_set_cfg 'xwiki.store.recyclebin.content.hint' 'file'
+'''%>
   echo '  Generating authentication validation and encryption keys...'
   xwiki_set_cfg 'xwiki.authentication.validationKey' "\$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
   xwiki_set_cfg 'xwiki.authentication.encryptionKey' "\$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"