Building container on RaspberryPi

258 views
Skip to first unread message

Maurice Güttler

unread,
Apr 30, 2020, 7:16:31 AM4/30/20
to singularity
Hi everyone,

I try to build a container via debootstrap on my RaspberryPI 4 with 2GB of RAM.
I want to build the container from scratch and later add my own software. Therefore, I don't want to try/use a docker image.
Unfortunately, it breaks at the start of the build process.

My recipe looks like this:
   Bootstrap: debootstrap
   MirrorURL: http://raspbian.raspberrypi.org/raspbian/
   OSVersion: buster
it is similar to the example file in examples/raspbian/Singularity.

The build command is:
   sudo -E singularity build --sandbox raspContainer ./singRpi4.def
the error is:
   INFO:    Starting build...
   E: Unable to execute target architecture
   FATAL:   While performing build: conveyor failed to get: while debootstrapping: exit status

The linux distribution is on is raspbian-buster.
The singularity version is 3.5.3.

Can anyone help me and explain what I'm doing wrong?


David Trudgian

unread,
Apr 30, 2020, 2:29:56 PM4/30/20
to singularity
Singularity is taking the target architecture for debootstrap from what Go will be reporting in `GOARCH`

Check:

dave@piran~> go env | grep GOARCH

The raspbian packages are `armhf` but I suspect that your `GOARCH` may show `arm` Can you confirm this?

If this is the issue then it will need to be fixed in the Singularity code. Using the docker://debian:buster image as the bootstrap source should be nearly equivalent to a debootstrap, and doesn't affect your ability to add your own software.


DT

Maurice Güttler

unread,
May 4, 2020, 3:01:21 PM5/4/20
to singularity
Yeah, you are absolutely right.

GOARCH is `arm`.

I looked into the code and found the line where the check is done. When I hardcode `armhf` at this position (I know it is not the best solution, I want to see if it progresses furher) it breaks with another error

W: Cannot check Release signature; keyring file not available /usr/share/keyrings/debian-archive-keyring.gpg

I now have to read about that problem


Thanks for the help so far

Maurice Güttler

unread,
May 4, 2020, 3:50:54 PM5/4/20
to singularity
Sorry, I was wrong it actually works. I jumped to the wrong error.

The problem was that I had a typo in my proxy configuration, so it couldn't download the packages. After fixing that it created the container without errors.

So the only thing is to fix the GOARCH environment entry.

Btw. I changed line 64 in internal/pkg/build/sources/conveyorPacker_debootstrap.go

Maurice Güttler

unread,
May 18, 2020, 4:44:43 AM5/18/20
to singularity
FYI: I fixed it for me by using dpkg-architecture and not GOARCH.

David Trudgian

unread,
May 18, 2020, 9:37:41 AM5/18/20
to singu...@lbl.gov
Hi Maurice,

Thanks for the update. I just took a look on RPM based machines (Fedora and CentOS8) where the `debootstrap` and `dpkg` packages are installed so that they can bootstrap debian distros with Singularity. In these cases there is no `dpkg-architecture` executable, but it appears we can use `dpkg --print-architecture` instead. This should be safe as `dpkg` is a hard requirement to be able to bootstrap, while the presence of `dpkg-architecture` is not.

dave@piran~> dpkg --print-architecture
amd64

dave@pi4 /> dpkg --print-architecture
armhf









--
You received this message because you are subscribed to the Google Groups "singularity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.
To view this discussion on the web visit https://groups.google.com/a/lbl.gov/d/msgid/singularity/d14690c5-b844-4f68-b6e5-52c61cad9c60%40lbl.gov.


--
David Trudgian
Sylabs Inc.

Maurice Güttler

unread,
May 20, 2020, 5:27:09 AM5/20/20
to singularity
Thanks for your remark. I was not aware of that, I'm only working on DEB based machines.
To unsubscribe from this group and stop receiving emails from it, send an email to singu...@lbl.gov.
Reply all
Reply to author
Forward
0 new messages