HN 표시: Apple의 컨테이너화 스택과 함께 Tailscale 사용

hackernews | | 📦 오픈소스
#뉴스
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

Apple의 컨테이너 스택은 Tailscale을 유저스페이스 네트워킹 모드로 실행해 별도의 포트 노출 없이 SSH 연결을 지원합니다. 이 방식은 컨테이너가 테일넷에 합류 후 MagicDNS를 통해 호스트나 별도 SSH 서버 설정 없이 안전하게 접속할 수 있게 합니다. 또한 인증 키를 Apple 키체인에 저장하여 macOS 환경에 최적화된 보안 관리 방법도 제시합니다.

본문

Apple's macOS containerization stack uses the Virtualization framework to spin up a minimal Linux host VM for each container instance. Since neither the macOS host kernel nor the specialized Linux guest VM kernel includes a native WireGuard kernel module, the container must run Tailscale in userspace networking mode instead of attaching to a standard kernel TUN device. The container example in this repo starts tailscaled with --tun=userspace-networking , authenticates the node using a Tailscale auth key and then enables Tailscale SSH. Once the container joins your tailnet, you can use Tailscale MagicDNS for naming and then connect to the container over Tailscale SSH without exposing any ports on the host or configuring a separate SSH server inside the container. This example also demonstrates a macOS-specific method of storing the Tailscale auth key in Apple Keychain. - Tag name: myservers - Tag owner: [email protected] - Note: server containers: myserver1, myserver2, ... - add the new tag to the Destination array: "myservers", - add Linux container usernames to the Destination users array: "player1", "player2", - change the "action": value from"check", to"accept", - (optional): remove "root", from theusers: array. - Generate an auth key using the Keys tab with the following flags enabled: - Reusable - Pre-authorized - newly generated tag - Copy the new auth key to the macOS clipboard. - Store the new auth key in Apple Keychain using store-ts-key-keychain.sh . ./build.sh ./run.sh - tailscale ssh player1@alpine-ts-server - container exec -it alpine-ts-instance /bin/sh Containerfile and tini-start.sh should work on other OCI‑compatible container platforms. However, those platforms typically provide a kernel TUN device, so this userspace networking technique is mainly a macOS‑specific workaround rather than a general best practice. Additional helper scripts provide macOS‑specific integration with Apple's container CLI: build.sh : Builds the container image.run.sh : Launches a container instance and retrieves the Tailscale auth key from Apple Keychain. It also demonstrates how to mount a local folder into a container using the--volume command-line option.cleanup.sh : Removes the container from your tailnet, removes the container instance and deletes the container image.store-ts-key-keychain.sh : Copies the Tailscale auth key from the system clipboard to Apple Keychain for later use byrun.sh .

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →