Docker hello_world not running

Hi,

I am working on a custom carrier board using following setup:

  • Colibri iMX7D 1 GB V1.1A
  • Kernel 5.4.193-5.7.3-devel+git.f5d73fd6e9f8
  • Based on Toradex BSP Layers and Reference Images for Yocto Project 5.7.3

I would like to use docker within this image, so I included docker-ce in the image recipe, added the meta-virtualization layer and bitbaked it. After installing it onto the target, I get following output regarding docker version:

root@colibri:~$ docker version
Client:
 Version:           19.03.15
 API version:       1.40
 Go version:        go1.14.15
 Git commit:        eb310fca49
 Built:             Fri Oct  6 08:09:44 2023
 OS/Arch:           linux/arm
 Experimental:      false

Server:
 Engine:
  Version:          19.03.15
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.14.15
  Git commit:       420b1d36250f9cfdc561f086f25a213ecb669b6f
  Built:            Thu Jan 28 21:43:36 2021
  OS/Arch:          linux/arm
  Experimental:     false
 containerd:
  Version:          v1.2.14-3-g3b3e9d5f6.m
  GitCommit:        3b3e9d5f62a114153829f9fbe2781d27b0a2ddac.m
 runc:
  Version:          1.0.0-rc8
  GitCommit:        425e105d5a03fabd737a126ad93d62a9eeede87f-dirty
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683-dirty

Now when I run the docker ‘hello-world’ example I get following output:

root@colibri:~$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c4018b8bf438: Pull complete 
Digest: sha256:4f53e2564790c8e7856ec08e384732aa38dc43c52f02952483e3f003afbf23db
Status: Downloaded newer image for hello-world:latest
http: invalid Host header

What am I doing wrong or what can I do to make the example work?

Here is the output of the images:

root@colibri:~$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hello-world         latest              38d49488e3b0        5 months ago        4.85kB

Thank you for your support on this.

Cheers,
Rob

Hi Robbie,

It seems like this is a known issue from the upstream Golang client fails to attach to streams with "http: invalid Host header" with go1.20.6, go1.19.11 · Issue #45935 · moby/moby · GitHub.

What is the hash of meta-virtualization you used? Because it may be something that needs to be fixed on their side.

Hi @leon.tx,

Thanks for the quick response. The hash is 35c723774ee06b3c1831f00a2cbf25cbeae132e1 (this is on dunfell branch).

What could I do to resolve this issue?

Thanks.

Rob

Hi @Robbie !

Quickly reading the link shared by @leon.tx, seems like updating it could help.

Have you tried it?

Btw, Toradex has the TorizonCore, which is a ready to use distro with Docker, OTA client update (to be used with Torizon Platform) and a very nice developer experience with several tools to make your development easier.

Since you would like to have containers on your embedded OS, maybe you would like to test TorizonCore :slight_smile:

Best regards,

Hi @henrique.tx,

Thanks for pointing out the TorizonCore. We are nearly at the end of the project development - so there is no room for switching to TorizonCore. But maybe we could switch for the upcoming project…

Regarding updating, what should I update? The go-1.14.bb recipe (and all the files contained within the directory)? So I tried this but had no luck. It complained with errors…

state summary: Wanted 2373 Found 0 Missed 2373 Current 0 (0% match, 0% complete)
NOTE: Executing Tasks
ERROR: go-native-1.20.7-r0 do_compile: Execution of '/home/u2912293/projects/BSPConnectivityNode/build/tmp/work/x86_64-linux/go-native/1.20.7-r0/temp/run.do_compile.1140380' failed with exit code 1
ERROR: Logfile of failure stored in: /home/u2912293/projects/BSPConnectivityNode/build/tmp/work/x86_64-linux/go-native/1.20.7-r0/temp/log.do_compile.1140380
Log data follows:
| DEBUG: Executing shell function do_compile
| Building Go cmd/dist using /home/u2912293/projects/BSPConnectivityNode/build/tmp/work/x86_64-linux/go-native/1.20.7-r0/go1.4/go. (go1.4-bootstrap-20170531 linux/amd64)
| can't load package: package ./cmd/dist: found packages build.go (main) and notgo117.go (building_Go_requires_Go_1_17_13_or_later) in /home/u2912293/projects/BSPConnectivityNode/build/tmp/work/x86_64-linux/go-native/1.20.7-r0/go/src/cmd/dist
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/u2912293/projects/BSPConnectivityNode/build/tmp/work/x86_64-linux/go-native/1.20.7-r0/temp/run.do_compile.1140380' failed with exit code 1
ERROR: Task (/home/u2912293/projects/BSPConnectivityNode/build/../layers/openembedded-core/meta/recipes-devtools/go/go-native_1.20.7.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1176 tasks of which 1 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 2 seconds

Is this approach correct? Or is there a better method for updating recipe files?

Cheers
Rob

Hi @Robbie ,

I saw that you used the most recent dunfell version of meta-virtualization, which is commit 35c723774ee06b3c1831f00a2cbf25cbeae132e1 at the time of writing this.

Did you take a look at how we implement Docker in TorizonCore at our meta-toradex-torizon layer? There we have a .bbappend file that downloads a more recent version of Docker CE than the one present by default in the dunfell version of meta-virtualization, along with some additional patches.

We also use an older dunfell version of meta-virtualization for TorizonCore 5, which currently is this one:

You can verify this by downloading our layers for TorizonCore 5 with repo sync, dunfell-5.x.y branch, as instructed here:

See if Docker works if you use our setup for meta-toradex-torizon with this specific version of meta-virtualization. This may be an easier alternative than trying to update the Golang recipe.

Best regards,
Lucas Akira