Containers

The containers are currently using Fedora 43 as the base operating system. C++ and GCC compilers are installed for the manual building of PDAL and GDAL.

Note the installation of both PDAL and PDAL-devel - PDAL documentation does not mention that PDAL-devel is required for compiling from source.

SSH is installed and customized for use in Containers. Future versions will be tied to Tailscale and Tailscale SSH. Port 22 is exposed. A keyfile is provided.

Post Install Steps

After cloning the git repo:

  1. Run a docker build command for the base image
  2. Run a docker build command targeting the waiter stage
  3. Start the container image

Named Build Stages

Info

Further Container usage and documentation is located in the stages page.

Image building uses Multi-stage builds. Each stage can be used as the image to use. The stages are:

  • base: Base Operating System (using Fedora 43). Operating system packages, Python UV, and SSH are all set up here.
  • builder: Copy of base stage. Required project components are copied into the Container and UV creates a venv and installs Python Packages here. User account is set up.
  • runner: Copy of builder stage with an Entrypoint of uv run.
  • waiter: Copy of builder stage with an Entrypoint designed to keep the container running and waiting (waiter = waiting, get it?) for commands. Useful for Development.

Building the Base Image

Note

Example commands below are using podman instead of docker. Docker commands are exactly the same - just replace ‘podman’ with ‘docker’

    podman build --target waiter -t lidar-waiter:latest -f dockerfile-prod

Where:

  • target: The build stage to use
  • t: Image Tag to apply. Use the pattern lidar-:latest for now. If you want to save a specific Image, replace the ’latest’ text with a different name. Images that use the ’latest’ tag are replaced!
  • f: Containerfile to use. Options are dockerfile-dev or dockerfile-prod.

Starting the waiter image

    podman run --replace -d \
      --name lidar-waiter \
      -v /mnt/local/datasets:/app/data:Z \
      -p 8877:8877 \
      -p 9922:22 \
      localhost/lidar-waiter:latest

Where:

  • d: Run detached (as in, don’t follow the Container’s log in the console instance being used)
  • name: Container Name
  • v: Datasets volume location, mounted to /app/data inside the Container
  • p <port number 1>:8877: Access Port
  • p <port number 2>:22: SSH Port
  • lidar-waiter: Image name to use (Created in the build step)

Entering the running waiter container and opening a terminal

    # Fish Shell
    podman exec -it lidar-waiter fish
    
    # Bash Shell
    podman exec -it lidar-waiter bash
Warning

A bug is preventing the usage of the ‘worker’ user when connecting to any of the images. Use the username ‘root’ until this is fixed.

Container File notes

  • Set chown ownership of .venv as USERNAME:USERNAME
  • Fedora uses wheel for sudoers
  • /app folder is set to be owned by USERNAME
  • When running entrypoint.sh, the user is switched to USERNAME
  • Up to ENTRYPOINT, root user is used
  • pycharm needs to connect via root, not USERNAME. Not sure why that connecting as USERNAME does not work
  • Healthchecks are not used - not part of the Podman platform