Custom Container Images - Pull from non remote registry

A Stagg

Cadet
Joined
Feb 29, 2024
Messages
2
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)

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.
 

A Stagg

Cadet
Joined
Feb 29, 2024
Messages
2
Some notes on saving/exporting the docker images: When running the `docker save` command, the resulting file is created in current location of the terminal you're using.

If you receive an error message along the lines of "open .docker_temp_xxxxxxxxxx: Access is denied." It means you can't write the file to that location.

My suggestion is navigate the terminal to the Share root, or image root on your share, to skip the above step of transfering the .tar file to the network share.
 
Top