content: # ╔═════════════════════════════════════════════════════╗
  # ║                       SETUP                         ║
  # ╚═════════════════════════════════════════════════════╝
  # GLOBAL
    ARG APP_UID=1000 \
        APP_GID=1000 \
        BUILD_SRC=Tantalor93/dnspyre.git \
        BUILD_ROOT=/go/dnspyre
    ARG BUILD_BIN=${BUILD_ROOT}/dnspyre
  
  # :: FOREIGN IMAGES
    FROM 11notes/distroless AS distroless  
    
  # ╔═════════════════════════════════════════════════════╗
  # ║                       BUILD                         ║
  # ╚═════════════════════════════════════════════════════╝
  # :: DNSPYRE
    FROM 11notes/go:1.25 AS build
    ARG APP_VERSION \
        BUILD_SRC \
        BUILD_ROOT \
        BUILD_BIN
  
    RUN set -ex; \
      eleven git clone ${BUILD_SRC} v${APP_VERSION}
  
    RUN set -ex; \
      cd ${BUILD_ROOT}; \
      eleven go build ${BUILD_BIN} main.go; \
      eleven distroless ${BUILD_BIN};
  
  
  # ╔═════════════════════════════════════════════════════╗
  # ║                       IMAGE                         ║
  # ╚═════════════════════════════════════════════════════╝
  # :: HEADER
    FROM scratch
  
    # :: default arguments
      ARG TARGETPLATFORM \
          TARGETOS \
          TARGETARCH \
          TARGETVARIANT \
          APP_IMAGE \
          APP_NAME \
          APP_VERSION \
          APP_ROOT \
          APP_UID \
          APP_GID \
          APP_NO_CACHE
  
    # :: default environment
      ENV APP_IMAGE=${APP_IMAGE} \
          APP_NAME=${APP_NAME} \
          APP_VERSION=${APP_VERSION} \
          APP_ROOT=${APP_ROOT}
  
    # :: multi-stage
      COPY --from=distroless / /
      COPY --from=build ${APP_ROOT}/ /
  
  # :: EXECUTE
    USER ${APP_UID}:${APP_GID}
    ENTRYPOINT ["/usr/local/bin/dnspyre"]