toolfixes
This commit is contained in:
@@ -10,6 +10,9 @@ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
||||
CONTAINER_NAME="zero-os-dev"
|
||||
BUILDER_IMAGE="zero-os-builder:latest"
|
||||
|
||||
# Default to verbose, streaming logs for dev flows unless explicitly disabled
|
||||
export DEBUG="${DEBUG:-1}"
|
||||
|
||||
# Source common functions
|
||||
source "${SCRIPT_DIR}/lib/common.sh"
|
||||
|
||||
@@ -38,9 +41,38 @@ Examples:
|
||||
EOF
|
||||
}
|
||||
|
||||
function ensure_builder_image() {
|
||||
section_header "Ensuring Builder Image"
|
||||
# Check for existing image under common tags (short and localhost-qualified)
|
||||
local candidates=("$BUILDER_IMAGE" "localhost/${BUILDER_IMAGE}")
|
||||
for img in "${candidates[@]}"; do
|
||||
if podman image exists "$img" 2>/dev/null; then
|
||||
log_info "Found builder image: ${img}"
|
||||
BUILDER_IMAGE="$img"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
log_warn "Builder image not found locally; building: ${BUILDER_IMAGE}"
|
||||
safe_execute podman build -t "${BUILDER_IMAGE}" -f "${PROJECT_ROOT}/Dockerfile" "${PROJECT_ROOT}"
|
||||
if podman image exists "$BUILDER_IMAGE" 2>/dev/null; then
|
||||
log_info "Builder image built successfully: ${BUILDER_IMAGE}"
|
||||
return 0
|
||||
fi
|
||||
# As a fallback, also tag with localhost to satisfy Podman short-name policy
|
||||
local local_tag="localhost/${BUILDER_IMAGE}"
|
||||
log_info "Tagging builder image as ${local_tag}"
|
||||
safe_execute podman tag "${BUILDER_IMAGE}" "${local_tag}" || true
|
||||
if podman image exists "$local_tag" 2>/dev/null; then
|
||||
BUILDER_IMAGE="$local_tag"
|
||||
fi
|
||||
}
|
||||
|
||||
function dev_container_start() {
|
||||
section_header "Starting Development Container"
|
||||
|
||||
# Ensure builder image exists (handles clean --all case and short-name policy)
|
||||
ensure_builder_image
|
||||
|
||||
# Check if container already exists
|
||||
if podman container exists "$CONTAINER_NAME" 2>/dev/null; then
|
||||
if podman container inspect "$CONTAINER_NAME" --format '{{.State.Status}}' | grep -q "running"; then
|
||||
|
||||
Reference in New Issue
Block a user