Cant install smbclient nextcloud docker container

Hello to all. Having a problem install nextcloud to raspberry pi docker compose, is working fine i try to install smbclient thru the console using portainer and i get this message

apt install smbclient
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package smbclient

i also try apt update and i get
Err:1 http://deb.debian.org/debian buster InRelease
Temporary failure resolving ‘deb.debian.org
Reading package lists… Done
Building dependency tree
Reading state information… Done
All packages are up to date.
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease Temporary failure resolving ‘deb.debian.org

to my is like i am not going out to the internet from this container, my other containers apps if i send a ping or update do not have any problems also if i try to update my pi no problem. Can some one help any ideas
Thank you

Did you install smbclient in a separate container? If so, you’ll need to link it to the Nextcloud container.

Also, I’m love to see your docker compose file if you care to post or dm.

I have exactly the same issue. I have installed nextcloud original image in docker on a raspberry pi and somehow it didn’t come with smbclient installed in it. I’m trying to add an external extorage through smb but as you can see until I get smbclient installed it won’t be possible.
My docker compose file looks like:

    version: '3'
services:

  proxy:
    image: budry/jwilder-nginx-proxy-arm:latest
    labels:
      - "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true"
    container_name: nextcloud-proxy
    networks:
      - nextcloud_network
    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_network
    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: yobasystems/alpine-mariadb:latest
    container_name: nextcloud-mariadb
    networks:
      - nextcloud_network
    volumes:
      - db:/var/lib/mysql
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MYSQL_ROOT_PASSWORD=passwd
      - MYSQL_PASSWORD=passwd
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
    restart: unless-stopped
  
  app:
    image: nextcloud:latest
    container_name: nextcloud-app
    networks:
      - nextcloud_network
    depends_on:
      - letsencrypt
      - proxy
      - db
    volumes:
      - nextcloud:/var/www/html
      - ./app/config:/var/www/html/config
      - ./app/custom_apps:/var/www/html/custom_apps
      - ./app/data:/var/www/html/data
      - ./app/themes:/var/www/html/themes
      - /etc/localtime:/etc/localtime:ro
    environment:
      - VIRTUAL_HOST=nextcloud.example.com
      - LETSENCRYPT_HOST=nextcloud.example.com
      - LETSENCRYPT_EMAIL=example@example.com
    restart: unless-stopped

volumes:
  nextcloud:
  db:

networks:
  nextcloud_network: 

I’m new in this and have very little knowledge so please if anybody can help me with this that would be amazing.
Thnak you.

[Bad idea removed] Proper method to add smbclient is using ansible configuration, which plays nice with docker-compose.

@just not a good advice. or?

@jorge_gomez @AFVare if you run apt install in the container all changes will be lost after next update of the image. and there are often updates. if you are fine with this: ok. do it.

it seems that dns isn’t working inside the container. you may check /etc/resolve.conf before you run apt install

wouldn’t it be easier to mount your smbshares on the host and add them as volumes to your container?

and use /var/smb_shares als “local” external storage.

1 Like

Thank you for the advices @Reiner_Nippes but the shares are in a different device that’s why I would like to mount them through smb.
I actually did the install through the container terminal but as you say it’ll be lost with the next update. Is there any way to build the smb along with the stack?

so do it. mount it on your host and make it available to your container.

download the docker files: https://github.com/nextcloud/docker/tree/master/20.0/apache (or whatever image you want to build) to a folder nextcloud below your docker-compose.yml

add any php module to docker-php-ext-install:

and change

in your compose file to

  app:
    build: ./nextcloud

you have to update docker files in nextcloud folder if a new version of nextcloud comes available. (20.0.1, 20.0.2, and so on.)

normally nextcloud changes only the version line ENV NEXTCLOUD_VERSION 20.0.2 for minor updates. but you never know.

Thank you!!!