Apps (Docker)

Apps will become an essential part of TrueNAS becoming more of a platform than just a NAS.

  • TrueNAS Apps system
    • TrueNAS runs its apps on Docker.
    • It has its own UI for managing apps from its catalogue, and all of them are Docker-based.
    • The TrueNAS UI lets you install an app from the catalogue, as a custom app, or from a YAML file.
    • TrueNAS Apps UI is a Docker Management Interface.
  • Docker
    • docker ps shows every running app, whichever manager created it, because on the command line there is no difference.
    • Docker lets you build internal networks between apps. manager support for this option wil vary.
  • Setting up the TrueNAS App System
    • The parent App folder, the app folder and it's child datasets all need to be created with apps preset.
    • If I want app use to access a smb share via a host path, you create the dataset with smb permissions first and then add the apps user into the allowed users as per Lawrence video
    • See the "Standardised Template" on how to layout your datasets.
  • docker run vs docker compose
    • They are not the same and handle container creation differently.
    • docker run is all CLI and hard to use.
    • docker compose is what you should use unless you given a reason not too.
    • The variables given to these binaries are different, but you can convert from one to he the other as they have parity.

Glossary

  • Application
    • is the thing you’re building: the whole set of services, networks, volumes and so on, described in your compose.yaml. The docs call this the “Compose application model” and refer to “multi-container applications”.
  • compose.yaml
    • Docker Compose YAML is one of the configuration file formats through which Docker Compose defines and manages multi-container Docker applications.
    • Put simply, it is a human-readable file that uses YAML to declare services, networks, and volumes of the app, a docker-compose.yml file allows you to define a multiple-container setup, declare the dependencies between services, and perform orchestration of container execution in an easy, efficient way.
    • The Docker documentation now recommends using compose.yaml instead of docker-compose.yaml. This change was made to align with the Compose Specification and to simplify the naming convention. However, Docker Compose still supports docker-compose.yaml and docker-compose.yml for backward compatibility.
  • Container
    • Image-Instance running an app process
    • A lightweight, runnable instance of a Docker Image.
    • A container is created when a Docker Image is executed.
    • It runs as an isolated process on the host machine but shares the host’s operating system kernel.
    • Multiple containers can run on the same system without interfering with each other.
  • Container Orchestration
    • Docker isn't normally run as-is in production. It's now more common to use an orchestration platform such as Kubernetes or Docker Swarm mode. These tools are designed to handle multiple container replicas, which improves scalability and reliability.
    • It is also normal just to run singular docker apps. This featur is only required if you need to start several apps at the same time for a single project.
  • Containers runtime config
    • This is the config and machine readble settings stored in the container
  • Docker
    • Docker is an OS‑level virtualization (or containerization) platform, which allows applications to share the host OS kernel instead of running a separate guest OS like in traditional virtualization. This design makes Docker containers lightweight, fast, and portable, while keeping them isolated from one another.
    • Docker has 2 editions
      • Community Edition (CE): Free, open‑source, used by individuals, dev teams, open‑source contributors.
      • Enterprise Edition (EE): Paid, with security enhancements, certified plugins/images, and enterprise support.
  • Dockerfile
    • A Dockerfile is a text file containing a series of instructions to build a custom Docker image. Think of it as a "recipe" for creating an image with your application code, dependencies, and configuration. Images are immutable templates used to spawn containers (runnable instances).
  • Docker Management Interface
    • TrueNAS Apps UI is a Docker Management Interface.
    • You can install another Docker manager (for example Portainer, Dockhand or Arcane), known as a Docker Management Interface to run alongside the TruneNAS UI.
    • Docker managers build YAML configs and run Docker commands. The apps and their configs live in Docker, and the managers only hold a reference to them.
    • Docker managers don’t share their configured apps with each other. Each one only knows about the apps it set up.
      • So if you setup an App with the TrueNAS UI then Arcane would not see it and vice vera. The software in theory could run in tandom, but this is definately not the case at the minute.
  • Image
    • Static, persisted container image
    • A file made up of multiple layers that contains the instructions to build and run a Docker container. It acts as an executable package that includes everything needed to run an application code, runtime, libraries, environment variables, and configurations.
    • Only one copy of an image needs be download because this image can be used by more app/project at a time.
    • The TrueNAS Docker instance keeps the images here:
      /mnt/.ix-apps/docker/image/overlay2/imagedb/content/sha256/
  • Project
    • is one running deployment of that application on a platform. A project’s name, set with the top-level name attribute, is used to group resources together and isolate them from other applications or other installations of the same Compose-specified application. Resources are labelled com.docker.compose.project, and you set the name with -p, COMPOSE_PROJECT_NAME or name:. By default it’s taken from the directory name.
    • You can run the same application twice on one host as two projects, which is why the two terms are separate.
  • Registry/Hub/Image Registry
    • A registry stores many static images
    • Examples
      • Docker Hub Container Image Library: The default public registry and the largest library of container images.
      • Private Registries: Companies often use private registries (like Amazon ECR, Google Artifact Registry, or Docker Hub private repos) to store their proprietary application images securely.

Commands

  • docker compose
    • How Compose works | Docker Docs
      • Learn how Docker Compose works, from the application model to Compose files and CLI, whilst following a detailed example.
      • With Docker Compose you use a YAML configuration file, known as the Compose file, to configure your application’s services, and then you create and start all the services from your configuration with the Compose CLI.

shoulders