pi-hole / docker-pi-hole

Pi-hole in a docker container
https://pi-hole.net
Other
8.42k stars 1.13k forks source link

Shouldn't a Raspbian with 64 bit kernel run aarch64 rather than armhf? #531

Closed Mellbourn closed 2 years ago

Mellbourn commented 4 years ago

This is a...

Description

I've switched to 64 bit architecture by setting arm_64bit=1 in /boot/config.txt

Expected Behavior

I thought I would get the aarch64 architecture inside the container.

Actual Behavior

I'm getting the armhf architecture.

Steps to Reproduce and debugging done

e.g. your docker run command, pages to visit, CLI commands you ran

  1. enter the container using exec
  2. echo $ARCH
  3. responds with armhf

Debug steps I have tried

Context and extra information

uname -a responds with this both inside and outside the container Linux raspberrypi4docker 4.19.75-v8+ #1270 SMP PREEMPT Tue Sep 24 18:59:17 BST 2019 aarch64 GNU/Linux

Your Environment

dschaper commented 4 years ago

Kernels and build depends on the host processor family. You can't change that.

dschaper commented 4 years ago

I think this is something that comes down to the docker engine. We build mulit-arch images and that's what is at https://hub.docker.com/r/pihole/pihole/tags. If you go to that page you will see the OS/ARCH pairs. When you pull a docker multi-arch image it is docker itself deciding on what ARCH to use. Is that correct @diginc?

Does everything Pi-hole related work? If you had the wrong ARCH then it would not even start the container. As an aside, I don't think there's anything to gain from 64 bit with our package.

Mellbourn commented 4 years ago

Kernels and build depends on the host processor family. You can't change that.

I'm not sure I understand. I have changed the kernel image of the host, that is a result of arm_64bit=1, it changes the kernel to using the 64 bit kernel image, kernel8.img. This makes the uname --machine report aarch64 instead of armv7l, both on the host and the container.

If I go to the https://hub.docker.com/r/pihole/pihole/tags page, there are both armhf and aarch64 images. So I'm still surprised that aarch64 isn't chosen.

Pi-hole seems to be working.

dschaper commented 4 years ago

The problem is that docker is still 32bit, it's not 64bit. The images run with docker thus are limited to 32bit. What does docker info show in full?

dschaper commented 4 years ago

https://www.raspberrypi.org/forums/search.php?keywords=docker&t=250730&sf=msgonly

Mellbourn commented 4 years ago
$ docker info
Client:
 Debug Mode: false

Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 2
 Server Version: 19.03.4
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.19.75-v8+
 Operating System: Raspbian GNU/Linux 10 (buster)
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 3.719GiB
 Name: raspberrypi4docker
 ID: GHLE:KSE6:UXZK:PQM4:KU3Q:MKCL:4F7B:XDYQ:4F75:YT57:2OYF:XW2X
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
dschaper commented 4 years ago

From a cursory read over of that link to the Raspberry Pi forums, it looks like this is what is expected and 64bit images actually won't start. But you aren't really missing anything by being 32bit still.

Mellbourn commented 4 years ago

I found that Balena OS supports full 64 bit docker containers on Raspberry Pi 4 https://www.balena.io/blog/balena-releases-first-fully-functional-64-bit-os-for-the-raspberry-pi-4/

Maybe I should give them a try. They even have a pi-hole docker image https://github.com/klutchell/balena-pihole. But maybe docker-pi-hole would also be 64 bit when hosted in a Balena OS docker.

dschaper commented 4 years ago

We are not in contact with that group nor do we support any of their images or configurations. I can not give any advice on that front.

diginc commented 4 years ago

Do any other multi-arch docker images you run properly run the arm64 images? Meaning if you pull or run the ubuntu:latest image it should result in the latest arm64 hash docker hub shows

We may need to tag the os/platform sightly differently in the deploy script when you compare some of the official images to ours...slight difference in arm64 vs arm64/v8

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.