I've been running into some roadblocks trying to use a custom containerized application on my TrueNAS Scale server (TrueNAS-SCALE-23.10.2) without pulling an image from a remote registry. A lot of these issues stem from out-of-date documentation, or threads that refer to pre 23/24 releases that have Docker natively installed.
I have overcome these hurdles but want to share because they were not obvious or covered in detail elsewhere.
Referenced threads (Use Container Registry Other Than Docker Hub) and (Load Local Docker Image Not From Registry?)
First- to export an image (from docker)
If you are developing/exporting from a Windows machine or get an "invalid tar header" error later, you need to use the -o flag.
Transfer the resulting .tar file to the network share. At first- I suggest dropping it in the root of the share to keep things simple. (example: DatasetName\Share)
I tried using the "full path/url" every way possible within the Manage Container Images > Pull Images. This was a complete failure and waste of time. Nothing I tried here worked.
Moving on to the second referenced thread. It provides a Kubernetes command to import the image from shell.
Running this at first will likely return a "failed to dial.... permission denied" error, depending on how you got to the shell (web ui, ssh, etc). I used the web ui shell, and needed to sudo the command to run it. I suspect that if you ssh in as an admin, that wouldn't be an issue.
Once the image is loaded, you can follow the "normal" path to install and configure the application. One thing to note, was that the image was listed with a prefix tag of docker.io/library in the container images list, but I did not have to specify that in the app installation process.
Hope this helps some fellow future frustrated users.
I have overcome these hurdles but want to share because they were not obvious or covered in detail elsewhere.
Referenced threads (Use Container Registry Other Than Docker Hub) and (Load Local Docker Image Not From Registry?)
First- to export an image (from docker)
Code:
docker save mycontainerizedapp mycontainerizedapp.tar
If you are developing/exporting from a Windows machine or get an "invalid tar header" error later, you need to use the -o flag.
Code:
docker save mycontainerizedapp -o mycontainerizedapp.tar
Transfer the resulting .tar file to the network share. At first- I suggest dropping it in the root of the share to keep things simple. (example: DatasetName\Share)
I tried using the "full path/url" every way possible within the Manage Container Images > Pull Images. This was a complete failure and waste of time. Nothing I tried here worked.
Moving on to the second referenced thread. It provides a Kubernetes command to import the image from shell.
Code:
k3s ctr images import mnt/DatasetName/Share/mycontainerizedapp.tar
Running this at first will likely return a "failed to dial.... permission denied" error, depending on how you got to the shell (web ui, ssh, etc). I used the web ui shell, and needed to sudo the command to run it. I suspect that if you ssh in as an admin, that wouldn't be an issue.
Once the image is loaded, you can follow the "normal" path to install and configure the application. One thing to note, was that the image was listed with a prefix tag of docker.io/library in the container images list, but I did not have to specify that in the app installation process.
Hope this helps some fellow future frustrated users.