@@ -539,14 +539,19 @@ distclean: clean
539539.PHONY : all cross fp-libs clean test test-aeabi-host test-legacy tar tags ETAGS doc distclean install uninstall FORCE
540540
541541# Container image settings (auto-detect docker or podman)
542- # For GHCR: set DOCKER_REGISTRY=ghcr.io and DOCKER_IMAGE_NAME=username/repo
543- DOCKER_REGISTRY ?= localhost
544- DOCKER_IMAGE_NAME ?= tinycc-armv8m
542+ DOCKER_REGISTRY ?= ghcr.io
543+ DOCKER_IMAGE_NAME ?= matgla/tinycc-armv8m
545544DOCKER_IMAGE_TAG ?= latest
546545DOCKER_FULL_IMAGE = $(DOCKER_REGISTRY ) /$(DOCKER_IMAGE_NAME ) :$(DOCKER_IMAGE_TAG )
547546
548547# Detect available container runtime (prefer podman, fallback to docker)
549- CONTAINER_RUNTIME := $(shell command -v podman 2>/dev/null || command -v docker 2>/dev/null)
548+ # User can override with: make docker-start CONTAINER_RUNTIME=docker
549+ CONTAINER_RUNTIME := $(shell \
550+ if command -v podman >/dev/null 2>&1 && podman info >/dev/null 2>&1; then \
551+ echo podman; \
552+ elif command -v docker >/dev/null 2>&1; then \
553+ echo docker; \
554+ fi)
550555ifeq ($(CONTAINER_RUNTIME ) ,)
551556 $(warning No container runtime found. Please install docker or podman.)
552557endif
@@ -571,6 +576,17 @@ endif
571576docker-build : container-build
572577docker-push : container-push
573578
579+ # Pull and start container interactively with current directory mounted
580+ docker-start :
581+ ifeq ($(CONTAINER_RUNTIME ) ,)
582+ $(error No container runtime found. Please install docker or podman.)
583+ else
584+ @echo "Pulling container image with $(CONTAINER_RUNTIME): $(DOCKER_FULL_IMAGE)"
585+ $(CONTAINER_RUNTIME) pull $(DOCKER_FULL_IMAGE)
586+ @echo "Starting container with $(CONTAINER_RUNTIME)..."
587+ $(CONTAINER_RUNTIME) run -it --rm -v $(CURDIR):/workspace $(DOCKER_FULL_IMAGE)
588+ endif
589+
574590help :
575591 @echo " make"
576592 @echo " build native compiler (from separate objects)"
@@ -602,6 +618,8 @@ help:
602618 @echo " build and push container image to registry"
603619 @echo " docker-build (legacy alias)"
604620 @echo " docker-push (legacy alias)"
621+ @echo " docker-start"
622+ @echo " pull and start container interactively (mounts current dir to /workspace)"
605623 @echo " Custom configuration:"
606624 @echo " The makefile includes a file 'config-extra.mak' if it is present."
607625 @echo " This file may contain some custom configuration. For example to"
0 commit comments