TheBrian

Members
  • Posts

    50
  • Joined

  • Last visited

Community Answers

  1. TheBrian's post in Docker update/version "not available" was marked as the answer   
    I figured it out. This isn't a CA or unRAID issue. It's OCI compatibility with DockerHub.
     
    Hopefully this can help someone else.
     
    My debugging process:
     
    I grepped through the entire directory /usr/local/emhttp/plugins/dynamix.docker.manager/include for "not available" which is the HTML label shown in the Unraid Docker UI

     
    To prove to myself that I found the right label, I added the "!" you see in the screenshot above.  This label is inside a case/switch condition. I.e., 0="up-to-date", 1="update ready", 2="rebuild ready" else, "not available" within the DockerContainers.php file. My containers were returning a NULL value which results in the "default/else" (not available message). This condition evaluates the variable "$updateStatus". This variable is set by an array read of the $info['updated'] array element.  This variable is set by DockerClient.php and where most of my debugging occurred.
     
    /usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php: I added the following to the "getRemoteVersionV2" function to assist in debugging.
    $file = '/tmp/foo.txt'; file_put_contents($file, PHP_EOL . $image . '(' . $manifestURL . ')' . '   ', FILE_APPEND);  
    This sent me on a reverse engineering journey and helped me create a little test script:
    #!/bin/bash repo="theoriginalbrian/phvalheim-server" TOKEN=$(curl --silent "https://auth.docker.io/token?scope=repository:$repo:pull&service=registry.docker.io" | jq -r '.token') curl --header "Accept: application/vnd.docker.distribution.manifest.v2+json" --header "Authorization: Bearer $TOKEN" "https://registry-1.docker.io/v2/$repo/manifests/latest"  
    The output of this little test script:
    {"errors":[{"code":"MANIFEST_UNKNOWN","message":"OCI manifest found, but accept header does not support OCI manifests"}]}  
    A bit of research landed me in DockerHub API documentation...in short, OCI images do not contain the SHA256 image digest (at least in the location DockerHub expects). 
    This led me to look at how I'm building my images. My dev system is just a simple Rocky 8.6 (EL) VM, which runs podman. By default, podman builds in the OCI format.  Simply passing "--format=docker" to my podman build command solved the issue.
     
    Results:
     
    After clicking "check for updates":

     
    After clicking "apply update":

     
    After clicking "apply update" and "check for updates:"

     
     
    TL;DR: add "--format=docker" to your docker/podman build command.
     
    -Brian