in the past I used Openhabian on a Raspberry Pi. Now I wante to move it into a docker container.
Right now I have set up Hypriot on a Raspberry and installed Openhab like this (from https://hub.docker.com/r/openhab/openhab/):
In Portainer I see the running image and I can access the Openhab Page in my browser.
But now I want to copy my textfiles (rules, things, …) and all this stuff into the according docker volume.
What is the best solution? Do I have to configure a samba server manually on the RP or is there a better solution?
I don’t know if this works on RPi’s yet, but there is a Remote SSH extension to OH that will use an SSH connection to access files directly on your RPi. See https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh-explorer and pay attention to the documentation as it requires you to set up ssh on your Windows machine in a certain way.
Beyond that then yes, you will need to create a Samba share and mount that share as a drive to your Windows machine (apparently it breaks if you don’t mount it as a drive) and access the files through the share.
To make it work with RPi you need to use “VSCode - Insiders” and it works well.
Thanks for the answers.
I configured a samba server but right now i dont get the permissions right. I shared the volume path ("/var/lib/docker/volumes/") and I can mount it in windows with the root user. But I only can add and modify in this folder not the subfolders. I can access and see all the other files as well but i cant copy my stuff into the according folders.
Probably it’s just one line in the samba config. Maybe some can help
workgroup = WORKGROUP
security = user
encrypt passwords = yes
client min protocol = SMB2
client max protocol = SMB3
comment = Samba-Freigabe
path = /home/shares/
read only = no
comment = Docker-Freigabe
path = /var/lib/docker/volumes/
read only = no
Okay my problem is solved. I rewrote the permission with:
“sudo chmod -R 777 /var/lib/docker/volumes/”
Docker seems fine after my changes. I was not sure if the container would start. But right now it seems fine.