# k3s cluster image with Navigator Helm charts and manifests # # This image is based on k3s and includes: # - Packaged Navigator Helm chart # - HelmChart CR for auto-deploying Navigator # - Custom entrypoint for DNS configuration in Docker environments # # Component images (navigator/server, navigator/sandbox) are # pulled at runtime from the distribution registry rather than bundled as tarballs. # Registry credentials are generated by the entrypoint script at container start. # # The helm charts are built by the docker:build:cluster mise task # and placed in deploy/docker/.build/ before this Dockerfile is built. ARG K3S_VERSION=v1.29.8-k3s1 FROM rancher/k3s:${K3S_VERSION} # Create directories for manifests and configuration RUN mkdir -p /var/lib/rancher/k3s/server/manifests \ /var/lib/rancher/k3s/server/static/charts \ /etc/rancher/k3s \ /opt/navigator/manifests # Copy entrypoint script that configures DNS for Docker environments # This script detects the host gateway IP and configures CoreDNS to use it COPY deploy/docker/cluster-entrypoint.sh /usr/local/bin/cluster-entrypoint.sh RUN chmod +x /usr/local/bin/cluster-entrypoint.sh # Copy healthcheck script that verifies cluster readiness COPY deploy/docker/cluster-healthcheck.sh /usr/local/bin/cluster-healthcheck.sh RUN chmod +x /usr/local/bin/cluster-healthcheck.sh # Registry credentials for pulling component images at runtime are generated # by the entrypoint script at /etc/rancher/k3s/registries.yaml. # Copy packaged helm chart to static directory for serving via k3s API COPY deploy/docker/.build/charts/*.tgz /var/lib/rancher/k3s/server/static/charts/ # Copy Kubernetes manifests to a persistent location that won't be overwritten by the volume mount. # The bootstrap code will copy these to /var/lib/rancher/k3s/server/manifests/ after cluster start. COPY deploy/kube/manifests/*.yaml /opt/navigator/manifests/ # Use custom entrypoint that configures DNS before starting k3s ENTRYPOINT ["/usr/local/bin/cluster-entrypoint.sh"] HEALTHCHECK --interval=5s --timeout=5s --start-period=20s --retries=60 \ CMD ["/usr/local/bin/cluster-healthcheck.sh"]