Workspace IndexDev Notes › Apple container

#146PoC

Apple container

Apple's official open-source tool for running Linux containers as lightweight VMs on Apple Silicon — a Docker Desktop alternative candidate.

Not yet scoped. github.com/apple/container

Why

A Docker Desktop alternative candidate for local infra across two PCs and midnight automated jobs.

How it works

Apple's official open source — runs Linux containers as lightweight VMs on Apple Silicon Macs. Written in Swift, OCI-compatible (pulls/pushes Docker images as-is), at 1.0.0, requires macOS 26.

Related code

"""Apple `container`: parse an OCI image reference and mock a pull + run,
illustrating the "container run <image>" mental model (no real container ops).
"""
from dataclasses import dataclass


@dataclass
class ImageRef:
    name: str
    tag: str

    @classmethod
    def parse(cls, ref):
        if ":" in ref:
            name, tag = ref.rsplit(":", 1)
        else:
            name, tag = ref, "latest"
        return cls(name=name, tag=tag)

    def __str__(self):
        return f"{self.name}:{self.tag}"


def pull(image: ImageRef):
    print(f"$ container pull {image}")
    print(f"  -> resolving OCI manifest for {image.name}, tag={image.tag}")
    print(f"  -> layers fetched (mocked), image ready as lightweight VM image")


def run(image: ImageRef, command):
    print(f"$ container run {image} {' '.join(command)}")
    print(f"  -> booting lightweight Linux VM on Apple Silicon (mocked)")
    print(f"  -> exec: {' '.join(command)}")
    return {"exit_code": 0, "stdout": "hello from inside the container (mocked)"}


for ref in ["nginx:1.27", "alpine"]:
    image = ImageRef.parse(ref)
    pull(image)
    result = run(image, ["echo", "hello"])
    print(f"  exit_code={result['exit_code']} stdout={result['stdout']!r}\n")

← All Dev Notes · Workspace Index · Top ↑

Apple `container` 써보기

애플 공식 오픈소스 — Mac(Apple Silicon)에서 Linux 컨테이너를 경량 VM으로 실행 — Docker Desktop 대안 검토.

아직 범위 미정. github.com/apple/container

Docker Desktop 대안 검토 — 2대 PC·자정 자동작업의 로컬 인프라 후보.

동작 방식

애플 공식 오픈소스 — Mac(Apple Silicon)에서 Linux 컨테이너를 경량 VM으로 실행. Swift 제작 · OCI 호환(Docker 이미지 그대로 pull/push) · 1.0.0 릴리스 · macOS 26 필요.

관련 코드

"""Apple `container`: parse an OCI image reference and mock a pull + run,
illustrating the "container run <image>" mental model (no real container ops).
"""
from dataclasses import dataclass


@dataclass
class ImageRef:
    name: str
    tag: str

    @classmethod
    def parse(cls, ref):
        if ":" in ref:
            name, tag = ref.rsplit(":", 1)
        else:
            name, tag = ref, "latest"
        return cls(name=name, tag=tag)

    def __str__(self):
        return f"{self.name}:{self.tag}"


def pull(image: ImageRef):
    print(f"$ container pull {image}")
    print(f"  -> resolving OCI manifest for {image.name}, tag={image.tag}")
    print(f"  -> layers fetched (mocked), image ready as lightweight VM image")


def run(image: ImageRef, command):
    print(f"$ container run {image} {' '.join(command)}")
    print(f"  -> booting lightweight Linux VM on Apple Silicon (mocked)")
    print(f"  -> exec: {' '.join(command)}")
    return {"exit_code": 0, "stdout": "hello from inside the container (mocked)"}


for ref in ["nginx:1.27", "alpine"]:
    image = ImageRef.parse(ref)
    pull(image)
    result = run(image, ["echo", "hello"])
    print(f"  exit_code={result['exit_code']} stdout={result['stdout']!r}\n")

← 전체 개발 노트 · 워크스페이스 인덱스 · 맨 위 ↑