jetson-containers icon indicating copy to clipboard operation
jetson-containers copied to clipboard

Building on WSL2 from x86 host

Open cschreib-ibex opened this issue 3 years ago • 0 comments

Hello! I have been following the instructions on this repo and this article to get docker images for the Jetson Xavier NX from my work machine, which is running Windows 10 Pro 64bit and Windows Subsystem for Linux (WSL).

I hit a roadblock towards the end:

> Executing task: make 32.4.4-nx-jetpack-4.4.1 <

make -C /home/cschreib/jetson-containers/docker/jetpack 32.4.4-nx-jetpack-4.4.1
make[1]: Entering directory '/home/cschreib/jetson-containers/docker/jetpack'
docker build  \
                                --build-arg IMAGE_NAME=l4t \
                                -t l4t:32.4.4-nx-jetpack-4.4.1-base \
                                - < 4.4.1/nx/base/Dockerfile
[+] Building 0.6s (2/3)                                                                                                                                                                     
[+] Building 0.6s (3/3) FINISHED                                                                                                                                                            
 => [internal] load build definition from Dockerfile                                                                                                                                   0.0s
 => => transferring dockerfile: 1.69kB                                                                                                                                                 0.0s
 => [internal] load .dockerignore                                                                                                                                                      0.0s
 => => transferring context: 2B                                                                                                                                                        0.0s
 => ERROR [internal] load metadata for docker.io/library/l4t:32.4.4-nx                                                                                                                 0.5s
------
 > [internal] load metadata for docker.io/library/l4t:32.4.4-nx:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: exit status 1, out: ``
jetpack.mk:598: recipe for target '32.4.4-nx-jetpack-4.4.1-base' failed
make[1]: *** [32.4.4-nx-jetpack-4.4.1-base] Error 1
make[1]: Leaving directory '/home/cschreib/jetson-containers/docker/jetpack'
Makefile:80: recipe for target '32.4.4-nx-jetpack-4.4.1' failed
make: *** [32.4.4-nx-jetpack-4.4.1] Error 2

After a lot of digging around, I found a workaround (inspired from this bug report): edit all the Dockerfile found in jetpack/4.4.1/nx/* and replace the line at the top

FROM ${IMAGE_NAME}:***blabla***

by

FROM --platform=linux/arm64/v8 ${IMAGE_NAME}:***blabla***

I don't know Docker enough to figure out exactly:

  • why this is needed, while the previous images in the chain built fine,
  • whether it's an omission of this repo or a bug in docker,
  • whether it would be safe to add this line in all cases.

But I thought I would report the issue and solution here, in case someone else encounters the problem.

cschreib-ibex avatar Nov 22 '21 16:11 cschreib-ibex