I solved the problem. 
The additional capability parameters are host configs and have to be added 
to the "extra_host_config as list:

c.DockerSpawner.extra_host_config = {
    'network_mode': network_name,
    'mem_limit': '24G',
    'security_opt': ['apparmor:unconfined'],
    'cap_add': ['SYS_ADMIN','DAC_READ_SEARCH'],

}

In addition it is necessary to specify another parameter for linux 
security: "security_opt"

With this configuration it is possible to use mount in jupyter notebook 
containers. 



Am Mittwoch, 3. Juli 2019 13:01:36 UTC+2 schrieb Bernhard Jungwirth:
>
> Hi,
>
> I would like to mount a windows network share in my jupyter notebook. 
>
> I have a setup with Jupyterhub and Jupyter Notebooks in Docker. 
>
> In my notebook docker images cifs-utils  are installed: 
> RUN apt-get install cifs-utils keyutils -y
>
>
> I connect to the JupyterHub  server and start a notebook and in JupyterLab 
> I opened the terminal and I executed a mount command: 
> mount.cifs -o user=Domainuser,domain=DOMAIN,rw,noauto, //domain.com/home 
> /home/joyvan/nethome
>
> But this command ends with the message: 
> Unable to apply new capability set. 
>
> I have to add the following options to  the docker run command in 
> JupyterHub setup:
> –cap-add SYS_ADMIN --cap-add DAC_READ_SEARCH
>
> How can i do this, nothing I have tried worked: 
>
> I have tried it as extra_create_kwargs, c.DockerSpawner.environment and 
> client_kwargs:
>
> c.DockerSpawner.extra_create_kwargs.update({ 'command': spawn_cmd })
> c.DockerSpawner.client_kwargs =  {'privileged': '' }
> c.DockerSpawner.client_kwargs = {
>     '--cap-add': 'SYS_ADMIN',
>     '--cap-add': 'DAC_READ_SEARCH',
> }
>
>
> Thanks, 
> Bernhard
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/78095fbe-14cc-433b-9485-28b58286d720%40googlegroups.com.

Reply via email to