Installing phoneinfoga on linux/arm64/v8

Intro#

phoneinfoga is an advanced tool to scan international phone numbers and retrieve basic information + extra details by leveraging third-party

You can self-host it on your machines (bare-metal or Docker install).

Official docs:

CAUTION

This project is stable but unmaintained. Latest release was on tag v2.11.0.

See: https://github.com/sundowndev/phoneinfoga#current-status

Problem#

There is an issue when trying to set up phoneinfoga with the official Docker images via Docker Compose on a Raspberry Pi 5 running with Rasbperry OS (64bits - lite).

$ docker compose up phoneinfoga
✘ Image sundowndev/phoneinfoga:stable Error no matching manifest for linux/arm64/v8 in the manifest list entries: no match for platform in manifest: not found
Error response from daemon: no matching manifest for linux/arm64/v8 in the manifest list entries: no match for platform in manifest: not found

This is because the project is not maintained anymore and was only being built for linux/arm64/v7 version leaving linux/arm64/v8 unsupported (see answer from project’s maintainer: https://github.com/sundowndev/phoneinfoga/issues/1236#issuecomment-1459506843).

Platform check#

To check your platform, run:

$ uname -m
 aarch64
$ docker info | grep -i architecture
 Architecture: aarch64

To check if a device uses ARMv7 (32-bit) or ARMv8/ARM64 (64-bit):

  • armv7l: ARMv7
  • aarch64 or arm64: ARMv8

First attempt#

The first attempt to solve this issue was to clone the official Git repo on the Raspberry Pi and build the image locally using the repo’s Dockerfile.

# Cloning repo
$ git clone https://github.com/sundowndev/phoneinfoga.git
$ cd phoneinfoga/

After cloning it, we adapt our docker-compose.yaml file to first include the build phase:

services:
    phoneinfoga:
    # docs: https://hub.docker.com/r/sundowndev/phoneinfoga/t
    # repo: https://github.com/sundowndev/phoneinfoga
    container_name: phoneinfoga
    restart: unless-stopped
    
    build:
      context: .
      dockerfile: Dockerfile
    
    image: phoneinfoga:local
    
    command:
      - "serve"
TIP

We add the :local image tag to make sure our Docker Compose install won’t try to retrive it from GHCR or Docker Hub.

We run it:

$ docker compose up --build phoneinfoga

But it fails:

154.4 ➤ YN0000: Failed with errors in 2m 33s
------
[+] up 0/1
 ⠙ Image phoneinfoga:local Building                                                                                                                                         212.3s
Dockerfile:6

--------------------
   4 |
   5 |     COPY ./web/client .
   6 | >>> RUN yarn install --immutable
   7 |     RUN yarn build
   8 |     RUN yarn cache clean
--------------------

failed to solve: process "/bin/sh -c yarn install --immutable" did not complete successfully: exit code: 1

Before going to the second and successful solution, we clean the previous build files currently cached:

# Removing build cache
$ docker builder prune -a -f
$ docker system df

# Removing the cloned repo source as well
$ rm -rf phoneinfoga

Successful solution#

The second solution is to create our own Dockerfile for phoneinfoga which will be built based on the official arm64 binary (available on the repo’s releases).

$ mkdir -p phoneinfoga
$ cd phoneinfoga

We adapt our docker-compose.yaml file:

services:
    phoneinfoga:
    # docs: https://hub.docker.com/r/sundowndev/phoneinfoga/t
    # repo: https://github.com/sundowndev/phoneinfoga
    container_name: phoneinfoga
    restart: unless-stopped
    build:
      context: .
      dockerfile: phoneinfoga.Dockerfile
    image: phoneinfoga:local
    
    command:
      - "serve"
    
    #ports: # to uncomment if no reverse-proxy (caddy, ...) is set up
    #  - "5000:5000"

and we create our phoneinfoga.Dockerfile file:

$ touch phoneinfoga.Dockerfile
FROM alpine:3.20

RUN apk add --no-cache ca-certificates curl

# Download official binary arm64
RUN curl -sSL https://github.com/sundowndev/phoneinfoga/releases/download/v2.11.0/phoneinfoga_Linux_arm64.tar.gz \
    | tar -xz -C /usr/local/bin \
    && chmod +x /usr/local/bin/phoneinfoga

EXPOSE 5000
ENTRYPOINT ["phoneinfoga"]
#CMD ["serve"]
WARNING

We let the Dockerfile only expose the entrypoint (phoneinfoga) but we want to control which commands to run at container boot in the docker-compose.yaml (see the : command: ["serve"])

We initiate the build + container start:

$ docker compose up --build phoneinfoga
[+] Building 30.1s (9/9) FINISHED
 => [internal] load local bake definitions                                                                                                                                   0.0s
 => => reading from stdin 554B                                                                                                                                               0.0s
 => [internal] load build definition from phoneinfoga.Dockerfile                                                                                                             0.1s
 => => transferring dockerfile: 394B                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/alpine:3.20                                                                                                               1.3s
 => [internal] load .dockerignore                                                                                                                                            0.1s
 => => transferring context: 2B                                                                                                                                              0.0s
 => [1/3] FROM docker.io/library/alpine:3.20@sha256:d9e853e87e55526f6b2917df91a2115c36dd7c696a35be12163d44e6e2a4b6bc                                                         1.2s
 => => resolve docker.io/library/alpine:3.20@sha256:d9e853e87e55526f6b2917df91a2115c36dd7c696a35be12163d44e6e2a4b6bc                                                         0.1s
 => => sha256:3f26bc2dec0b515f1c2818f6e13a8f1da1f88179a008445d4e587233386bff78 4.09MB / 4.09MB                                                                               0.6s
 => => extracting sha256:3f26bc2dec0b515f1c2818f6e13a8f1da1f88179a008445d4e587233386bff78                                                                                    0.2s
 => [2/3] RUN apk add --no-cache ca-certificates curl                                                                                                                        7.3s
 => [3/3] RUN curl -sSL https://github.com/sundowndev/phoneinfoga/releases/download/v2.11.0/phoneinfoga_Linux_arm64.tar.gz     | tar -xz -C /usr/local/bin     && chmod +x  14.1s
 => exporting to image                                                                                                                                                       4.5s
 => => exporting layers                                                                                                                                                      3.2s
 => => exporting manifest sha256:4defe16cea30086e69c0a55bbca05eaabe2465420b9f26b204510304781216c9                                                                            0.1s
 => => exporting config sha256:b7c3d35a1e6a794d3499d4722a47e0de9814bf8984000c793d8fd332933d6209                                                                              0.1s
 => => exporting attestation manifest sha256:aa699641cd647b8e39a2d065e9cbf6ae002907170049cc3c52b574b7e3167286                                                                0.2s
 => => exporting manifest list sha256:b42470305aa692ea0ec2453c9197989b8d190c6f95da63ab2886d1cc31f58d02                                                                       0.1s
 => => naming to docker.io/library/phoneinfoga:local                                                                                                                         0.0s
 => => unpacking to docker.io/library/phoneinfoga:local                                                                                                                      0.7s
 => resolving provenance for metadata file                                                                                                                                   0.0s
[+] up 2/2
 ✔ Image phoneinfoga:local Built                                                                                                                                             30.2s
 ✔ Container phoneinfoga   Created                                                                                                                                            5.5s
Attaching to phoneinfoga
phoneinfoga  | Listening on :5000
NOTE

You can check the logs interactively: docker compose logs -f phoneinfoga

Ready-to-use solution#

If you want to run this service on Docker on your host machine running a linux/arm64/v8 architecture and don’t want to build the image yourself, you can use the one I built and pushed on Docker Hub.

See: lcsrodriguez/phoneinfoga:linux-arm64-v8.

To check supported platform for this image:

$ docker inspect phoneinfoga | jq .[0].ImageManifestDescriptor.platform
{
  "architecture": "arm64",
  "os": "linux"
}