After updating to TOS 6.0 I’m eager to try out docker however I’m reluctant to start deploying containers as the Docker Root Dir is set to /opt/docker.
Yes, but I can’t give you any pointers through luci. I did it a few months ago after moving to HBL on TO6. Just follow the docker documentation using ssh
Edit: PS: An other UI way could be portrainer but I haven’t tested it
Sorry I don’t but it seems that it can be changed from luci
Refer here
Install Docker Community Edition
install docker-ce package for the commandline tools
install luci-app-dockerman package to get a control panel for docker containers in Luci
the default folder for docker in the dockerman luci interface is /opt/docker so you want to mount your storage at /opt or change the folder in Docker –> Overview –> Docker Root Dir and then restart the whole device, or the dockerd service.
BTW how did you manage to install Luci module for Docker, please?
When I am trying to install it I am getting this error:
Collected errors:
* check_data_file_clashes: Package libwebsockets-full wants to install file /usr/lib/libwebsockets.so
But that file is already provided by package * libwebsockets-openssl
* check_data_file_clashes: Package libwebsockets-full wants to install file /usr/lib/libwebsockets.so.14
But that file is already provided by package * libwebsockets-openssl
* opkg_install_cmd: Cannot install package luci-app-dockerman.
And as I found this topic, there is hard dependency on libwebsockets-openssl by reforis.
Yes, I am on stable branch. But as @makros suggested, forcing to overwrite existing files during installation helped and even reForis is working fine after that.
Based on the advice in this link posted by @lampra I did some investigating and found a workaround until a proper solution is presented by someone more knowledgeable.
In that link it is suggested to modify /etc/docker/daemon.json so that the graph key points to the new docker root path. Taking that information I found that daemon.json is created in /tmp/docker by /etc/init.d/dockerd every time the service is started.
The solution then is to modify /etc/init.d/dockerd and change the line: config_get data_root globals data_root "/opt/docker/"
to config_get data_root globals data_root "/path/to/new/docker/root/"
I have to point out that I had a portainer container setup before I did the switch and the container wouldn’t start after I copied the contents of /opt/docker to /srv/docker. I don’t recall the full error but it said something about a symlink to /opt/docker.
After deleting both the container and the volume and creating new ones it worked without issue.
This workaround is very likely to break with new updates of dockerd package and will have to be re-implemented. Whether that is to happen without data loss is anyone’s guess.
Based on your solution for dockerman here is what I can see in my dockerman configuration page. Don’t you have this configuration page? The root dir is editable.
I checked /etc/config/dockerd and it was empty for some reason. So I uninstalled dockerman, dockerd, and docker and reinstalled them again. I got an error saying that /etc/config/dockerd was different than the packaged one and the new one is at /etc/config/dockerd-opkg.
I deleted the dockerd file and renamed dockerd-opkg to dockerd and restarted the dockerd service.
Dockerman configuration page is properly populated now and I can change the docker root directory.