Smbclient not installed in the Nextcloud Docker official image?

Hello,

I just installed my personal Nextcloud server using the Docker official latest image.
However, I just noticed few issues.

The package smbclient or php-smbclient seems not to be installed by default.

I wasn’t able to install php-smbclient using:

# pecl install smbclient
downloading smbclient-1.0.0.tgz ...
Starting to download smbclient-1.0.0.tgz (32,017 bytes)
.........done: 32,017 bytes
4 source files, building
running: phpize
Configuring for:
PHP Api Version: 20170718
Zend Module Api No: 20170718
Zend Extension Api No: 320170718
building in /tmp/pear/temp/pear-build-defaultuser7zsv8b/smbclient-1.0.0
running: /tmp/pear/temp/smbclient/configure --with-php-config=/usr/local/bin/php-config
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20170718
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.16 (ok)
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable smbclient support... yes, shared
checking for libsmbclient support... yes, shared
checking for libsmbclient.h in default paths... not found
configure: error: Could not find libsmbclient.h
ERROR: /tmp/pear/temp/smbclient/configure --with-php-config=/usr/local/bin/php-config’ failed`

or

# apt install php-smbclient
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php-smbclient is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package 'php-smbclient' has no installation candidate

Even if the official GitHub says that this package have been integrated to the image.

I was able to install smbclient using “apt install smbclient” but that’s a fallback in case you don’t have “php-smbclient” and it have drawback like being slow to access certains folder and most of all, this:

Seems a lot of ressource just to list the content of this folder. And it’s just ONE folder, the others are just fine and have the same kind of file.

CPU: Intel Core i5-4570S @2.90 GHz
RAM: 4 GB DDR3 @1333 MHz
Storage: 1 x 64 GB SSD Kingston, 2 x 4TB HDD @5400 rpm Western Digital Green
Broadband connection: FTTLA (coaxial) 1Gbps for download & 60 Mbps for upload
OS: Ubuntu 18.04.1 LTS
Docker: 18.09.1
Docker-Compose: 1.23.2, build 1110ad0

My docker-compose.yml:

version: '3.5'

services:

  proxy:
    image: jwilder/nginx-proxy:alpine
    labels:
      - "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true"
    container_name: nextcloud-proxy
    networks:
            nextcloud:
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./proxy/conf.d:/etc/nginx/conf.d:rw
      - ./proxy/vhost.d:/etc/nginx/vhost.d:rw
      - ./proxy/html:/usr/share/nginx/html:rw
      - ./proxy/certs:/etc/nginx/certs:ro
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
    restart: unless-stopped

  letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: nextcloud-letsencrypt
    depends_on:
      - proxy
    networks:
            nextcloud:
    volumes:
      - ./proxy/certs:/etc/nginx/certs:rw
      - ./proxy/vhost.d:/etc/nginx/vhost.d:rw
      - ./proxy/html:/usr/share/nginx/html:rw
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
    restart: unless-stopped

  db:
    image: mariadb
    container_name: nextcloud-mariadb
    networks:
            nextcloud:
    volumes:
      - db:/var/lib/mysql
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MYSQL_ROOT_PASSWORD=*********
      - MYSQL_PASSWORD=*********
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=ncuser
    restart: unless-stopped

  app:
    image: nextcloud:latest
    container_name: nextcloud-app
    networks:
            nextcloud:
    depends_on:
      - letsencrypt
      - proxy
      - db
    volumes:
      - nextcloud-data:/var/www/html
      - /etc/localtime:/etc/localtime:ro
    environment:
      - VIRTUAL_HOST=cloud.mydomain.tld
      - LETSENCRYPT_HOST=cloud.mydomain.tld
      - LETSENCRYPT_EMAIL=administrator@mydomain.tld
    restart: unless-stopped

volumes:
  nextcloud-data:
          external: true
  db:

networks:
  nextcloud:
          name: my-network

Bump !

Do someone have installed this Docker image and have php-smbclient installed by default like it’s supposed to be ?

I’m in the same boat.

I really want to be able to add a windows share, but no luck. When I test the smb, it give me the same error you’re getting.

Mine was how I was mounting a share in the fstab.