Docker: failed to register layer: Error processing tar file(exit status 1): unexpected EOF

Hello,
I built a docker image in WSL, pushed it to my Docker Hub and then in the target device I’m running:
docker run --rm -it -v /tmp:/tmp -v /var/run/dbus:/var/run/dbus -v /dev:/dev -v /sys:/sys --device /dev/video2 --device /dev/video3 --device-cgroup-rule='c 226:* rmw' --device-cgroup-rule='c 199:* rmw' my-dockerhub-username/gst_example:version1

and I’m getting the following error:
docker: failed to register layer: Error processing tar file(exit status 1): unexpected EOF.
I’d appreciate your help. Thanks in advance!

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello!

It seems you’re encountering an error related to Docker image compatibility or network connectivity during the image pull process on your Toradex device running Torizon. Here are some steps you can take to troubleshoot and resolve this issue:

  1. Network Connectivity: Ensure that your device has a stable network connection to Docker Hub. This is crucial for successful image pulls. You can find more details on this here.

  2. Docker Configuration in WSL2: If you’re using a WSL2 environment, make sure your Docker setup is correct:

    • Only have either Docker Desktop or Docker Engine installed in WSL2, not both. More information can be found here.
    • If using Docker Desktop, check the “Use containerd for pulling and storing images” setting, as enabling this can cause issues with image pulls. Additional details are available here.
  3. Running Containers on Torizon: Use the recommended format for mounting volumes and accessing devices:

    # docker run --rm -it -v /var/run/dbus:/var/run/dbus -v /dev:/dev
    

    More guidance can be found here.

  4. Device Access in docker-compose.yml: Specify devices in your docker-compose.yml file as follows:

    device_cgroup_rules:
      - "c 254:* rmw"
    volumes:
      - type: bind
        source: /dev
        target: /dev
    

    You can read more about this here.

If the issue persists, consider rebuilding and repushing your Docker image, verifying that the image architecture matches your target device, and checking for any network firewall rules that might be blocking access to Docker Hub.

I hope these steps help you resolve the issue. If you have any more questions, feel free to ask!

Best regards,
Toradex AI Assistant.

Please, also check if these links can help you solve your problem:

https://developer.toradex.com/quickstart/firststeps/deploy-dockerfile/#step-1

https://developer.toradex.com/torizon/application-development/ide-extension/application-development-python-example/#peripheral-access.

Hey @asr_syk,

Can you share the full logs from the run?

Also, can you try and send a simple empty/hello_world from the same setup? Does this produce the same error?

-Eric

Hi @eric.tx!
Find the console log below:

torizon@verdin-imx8mp-15445693:~$ docker run --rm -it -v /tmp:/tmp -v /var/run/dbus:/var/run/dbus -v /dev:/dev -v /sys:/sys --device /dev/video2 --device /dev/video3 --device-cgroup-rule='c 226:* rmw' --device-cgroup-rule='c 199:* rmw' myID/gst_example_eim     
Unable to find image 'myID/gst_example_eim:latest' locally
latest: Pulling from myID/gst_example_eim
92c3b3500be6: Pull complete 
6d10cd063909: Pull complete 
38de08bd494d: Pull complete 
2f88c5727c46: Pull complete 
f3bb3403e8b9: Pull complete 
a05f8870c1b6: Pull complete 
fa7f96a6a20e: Pull complete 
af7ddf09a87e: Pull complete 
9ecb9131a73e: Pull complete 
68c3de42df08: Pull complete 
bdfa20e97fc3: Pull complete 
8898e28d25af: Pull complete 
9079a2783836: Pull complete 
2c1ce468d9f3: Extracting [==================================================>]      16B/16B
8105d7fb2193: Download complete 
6fa0b639e7b1: Download complete 
6e827c6623cf: Download complete 
15fe951dcfaa: Download complete 
cbbdb64f1505: Download complete 
docker: failed to register layer: Error processing tar file(exit status 1): unexpected EOF.

If I run a different image it works ok.

Hey @asr_syk,

I was able to grab the docker file prior to the name change, i hope that’s ok, I’ll delete soon/asap. You can always send in private information in a private message or to support@toradex.com.

Are you able to see if you are utilizing all of the memory of the device? Or possibility internet connection

torizon@verdin-imx8mp-07011921:~$ docker run --rm -it -v /tmp:/tmp -v /var/run/d bus:/var/run/dbus -v /dev:/dev -v /sys:/sys --device /dev/video2 --device /dev/v ideo3 --device-cgroup-rule=‘c 226:* rmw’ --device-cgroup-rule=‘c 199:* rmw’ [changed]
Unable to find image ‘[changed]:latest’ locally
latest: Pulling from [changed]
92c3b3500be6: Already exists
6d10cd063909: Already exists
38de08bd494d: Already exists
2f88c5727c46: Already exists
f3bb3403e8b9: Already exists
a05f8870c1b6: Already exists
fa7f96a6a20e: Already exists
af7ddf09a87e: Already exists
9ecb9131a73e: Already exists
68c3de42df08: Already exists
bdfa20e97fc3: Already exists
8898e28d25af: Pull complete
9079a2783836: Pull complete
2c1ce468d9f3: Pull complete
8105d7fb2193: Pull complete
6fa0b639e7b1: Pull complete
6e827c6623cf: Pull complete
15fe951dcfaa: Pull complete
cbbdb64f1505: Pull complete
Digest: sha256:32212a1f9172fece30567f709d25caa4e80539912cf2d1f010bc494ce0c2e1e6
Status: Downloaded newer image for [changed]
docker: Error response from daemon: error gathering device information while add ing custom device “/dev/video2”: no such file or directory.

-Eric

Hi Eric,
I sent an email to support@toradex.com.