Docker and maplibre-native issue

I building docker project using below instructions and output:

  1. build command seem to be succeed
@j:~$ docker build \
  -t maplibre-native-image \
  --build-arg USER_UID=$(id -u) \
  --build-arg USER_GID=$(id -g) \
  -f docker/Dockerfile \
  docker
[+] Building 2.7s (13/13) FINISHED                                                                                                                                                                  docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                          0.0s
 => => transferring dockerfile: 2.69kB                                                                                                                                                                        0.0s
 => [internal] load metadata for docker.io/library/ubuntu:24.04                                                                                                                                               2.5s
 => [auth] library/ubuntu:pull token for registry-1.docker.io                                                                                                                                                 0.0s
 => [internal] load .dockerignore                                                                                                                                                                             0.0s
 => => transferring context: 2B                                                                                                                                                                               0.0s
 => [1/7] FROM docker.io/library/ubuntu:24.04@sha256:561618e2c15bf2397621dd04f96926663a3b5616c189cf7e38db7e82f5c538ea                                                                                         0.0s
 => => resolve docker.io/library/ubuntu:24.04@sha256:561618e2c15bf2397621dd04f96926663a3b5616c189cf7e38db7e82f5c538ea                                                                                         0.0s
 => [internal] load build context                                                                                                                                                                             0.0s
 => => transferring context: 32B                                                                                                                                                                              0.0s
 => CACHED [2/7] RUN    apt-get update     && DEBIAN_FRONTEND=noninteractive apt-get install -y         apt-       curl         gnupg         sudo `# allows dev to install more packages w  0.0s
 => CACHED [3/7] RUN echo "Download and install Bazel"     && if [ "$(uname -m)" = "aarch64" ]; then         curl -fsSL s
 => CACHED [4/7] RUN groupmod --gid 1000 ubuntu     && usermod --uid 1000 --gid 1000 ubuntu     && chown -R 1000:1000 /home/ubuntu     && echo ubuntu ALL=(root) NOPASSWD:ALL > /etc/sudoers.d/ubuntu     &&  0.0s
 => CACHED [5/7] COPY startup.sh /usr/local/bin/startup.sh                                                                                                                                                    0.0s
 => CACHED [6/7] RUN chmod +x /usr/local/bin/startup.sh                                                                                                                                                       0.0s
 => CACHED [7/7] WORKDIR /app                                                                                                                                                                                 0.0s
 => exporting to image                                                                                                                                                                                        0.1s
 => => exporting layers                                                                                                                                                                                       0.0s
 => => exporting manifest sha256:cd7ebb92c421fd9be773f756c5942f22c9be913a51c64fd8c6f21f44177b3a39                                                                                                             0.0s
 => => exporting config sha256:562c6369cff84db1db0e30a6c4d39a8a7731c2ce09c732c3466a5f8ba0e886b9                                                                                                               0.0s
 => => exporting attestation manifest sha256:c18b4667b5920931e0e3e3b65ff4926bffd83da9225d24b698837414c3578b51                                                                                                 0.0s
 => => exporting manifest list sha256:9d435e8d5cbb6c19e1bcdd81fe058a5ffde64014fe4f81cc2f4cc7dfe1ecf24f                                                                                                        0.0s
 => => naming to docker.io/library/maplibre-native-image:latest                                                                                                                                               0.0s
 => => unpacking to docker.io/library/maplibre-native-image:latest                                                                                                                                            0.0s
j@j:~$ 
  1. I see images, but could not run in all possible ways I found

2.1)

j@j:~/docker$ docker images
                                                                                i Info →   U  In Use
IMAGE                          ID             DISK USAGE   CONTENT SIZE   EXTRA
maplibre-native-image:latest   c1d651f42a34       2.63GB          621MB    U  
j@j:~/docker$ docker run c1d651f42a34
 
ERROR: Docker container was not started properly.
       From the root of this repo, run the following command.
       You may add any command to perform in the container at the end of this command.
j@j:~/docker$ docker run maplibre-native-image:latest
 
ERROR: Docker container was not started properly.
       From the root of this repo, run the following command.
       You may add any command to perform in the container at the end of this command.

2.2)

docker run --rm -it -v "$PWD:/app/" -v "$PWD/docker/.cache:/home/ubuntu/.cache" maplibre-native-image
 
ERROR: Docker container was not started properly.
       From the root of this repo, run the following command.
       You may add any command to perform in the container at the end of this command.

Could you please share some pointers how to fix above?
Do I miss some files or path is wrong?
Probably I should change the command syntax?
Any help much appreciated!

P.S I could not post the text due to some forum issue, please help me to edit the post or share instruction how to do the same

[mod update: replaced the link to your post pastbin post with the content]

Since you seem to experience problems with the following the setup instructions for a project, wouldn’t it make more sense to open an issue in the GitHub project?

Furthermore, we know nothing about your setup, usually it helps to see the output of docker info to get an idea of your version, os, and some basic configurations. Please use the </> icon to format the output as preformatted text block, or use three backticks ``` in the line above and under the pasted text (like you do in markdown documents)

I just followed the instructions using latest Docker Desktop for Mac (version 4.86), and it seems to work just fine:

~ % git clone --recurse-submodules -j8 https://github.com/maplibre/maplibre-native.git
~ % cd maplibre-native

maplibre-native % docker build  \
  -t maplibre-native-image 
  --build-arg USER_UID=$(id -u) \
  --build-arg USER_GID=$(id -g) \
   -f docker/Dockerfile \
   docker

Note: I had to replace --build-arg USER_GID=$(id -g) with --build-arg USER_GID=11111 because my GID on my Mac is 20, which already exists in the image. Apart from that the command worked like a charm.

After building the image, I could start the container based on it according instructions:

maplibre-native % docker run --rm -it -v "$PWD:/app/" -v "$PWD/docker/.cache:/home/ubuntu/.cache" maplibre-native-image

Downloading and installing Rust...
info: downloading installer
warn: It looks like you have an existing rustup settings file at:
warn: /home/ubuntu/.cache/.rustup/settings.toml
warn: Rustup will install the default toolchain as specified in the settings file,
warn: instead of the one inferred from the default host triple.
info: profile set to minimal
info: default host triple is aarch64-unknown-linux-gnu
info: syncing channel updates for stable-aarch64-unknown-linux-gnu
info: latest update on 2026-07-16 for version 1.97.1 (8bab26f4f 2026-07-14)
info: downloading 3 components
        cargo installed                       10.09 MiB
     rust-std installed                       28.85 MiB
        rustc installed                       59.83 MiB                                                                                                                info: default toolchain set to stable-aarch64-unknown-linux-gnu

  stable-aarch64-unknown-linux-gnu installed - rustc 1.97.1 (8bab26f4f 2026-07-14)


Rust is installed now. Great!

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory (/home/ubuntu/.cache/.cargo/bin).

To configure your current shell, you need to source
the corresponding env file under /home/ubuntu/.cache/.cargo.

This is usually done by running one of the following (note the leading DOT):
. "/home/ubuntu/.cache/.cargo/env"            # For sh/bash/zsh/ash/dash/pdksh
source "/home/ubuntu/.cache/.cargo/env.fish"  # For fish
source "/home/ubuntu/.cache/.cargo/env.nu"  # For nushell
source "/home/ubuntu/.cache/.cargo/env.tcsh"  # For tcsh
. "/home/ubuntu/.cache/.cargo/env.ps1"        # For pwsh
source "/home/ubuntu/.cache/.cargo/env.xsh"   # For xonsh
Installing cxxbridge...
    Updating crates.io index
  Downloaded cxxbridge-cmd v1.0.157
  Downloaded 1 crate (75.9KiB) in 1.04s
  Installing cxxbridge-cmd v1.0.157
    Updating crates.io index
    Updating crates.io index
  Downloaded anstyle v1.0.10
  Downloaded strsim v0.11.1
  Downloaded clap_lex v0.7.4
  Downloaded termcolor v1.4.1
  Downloaded quote v1.0.40
  Downloaded unicode-ident v1.0.18
  Downloaded unicode-width v0.2.0
  Downloaded codespan-reporting v0.12.0
  Downloaded proc-macro2 v1.0.94
  Downloaded serde_derive v1.0.219
  Downloaded clap v4.5.36
  Downloaded serde v1.0.219
  Downloaded clap_builder v4.5.36
  Downloaded syn v2.0.100
  Downloaded 14 crates (1.1MiB) in 0.28s
   Compiling proc-macro2 v1.0.94
   Compiling unicode-ident v1.0.18
   Compiling anstyle v1.0.10
   Compiling clap_lex v0.7.4
   Compiling strsim v0.11.1
   Compiling termcolor v1.4.1
   Compiling unicode-width v0.2.0
   Compiling codespan-reporting v0.12.0
   Compiling clap_builder v4.5.36
   Compiling quote v1.0.40
   Compiling syn v2.0.100
   Compiling clap v4.5.36
   Compiling cxxbridge-cmd v1.0.157
    Finished `release` profile [optimized] target(s) in 7.21s
  Installing /home/ubuntu/.cache/.cargo/bin/cxxbridge
   Installed package `cxxbridge-cmd v1.0.157` (executable `cxxbridge`)
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

You must run this command in the cloned maplibre-native folder, not in any of the subfolders. It appears like you changed into the docker subfolder, and run your commands there. Apparently, the container expects the projects root folder to be available inside the container in the /app folder.