본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)5.4k · #14964

azldev-mock

하는 일

이 스킬은 azldev를 사용해 mock chroot 안에서 패키지를 실행하고 RPM 파일을 점검하는 방법을 보여 줍니다. 출시 전에 빌드된 패키지를 안전하게 확인하려는 개발자를 위한 것입니다.

사용하는 경우

  • ✓RPM을 빌드했고 내 컴퓨터에 설치하지 않고 테스트하고 싶을 때.
  • ✓RPM이 설치되지 않아 오류 세부 정보를 보고 싶을 때.
  • ✓빌드된 패키지의 파일 목록이나 의존성을 확인해야 하는 경우.

스킬 링크

https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-mock/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-mock/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“패키지용 RPM을 빌드했습니다. mock chroot에서 테스트하고 파일 목록과 의존성을 확인해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 비대화형 입력으로 mock 셸에서 명령을 실행하고, 패키지 정보를 읽은 뒤 격리된 환경에서 설치를 다시 시도합니다. 호스트에는 아무것도 설치하지 않습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Test and inspect packages in a mock chroot

Never install built RPMs on the host. They target the distro you are building, not your dev machine. Use a mock chroot instead.

azldev tests and inspects packages inside mock build roots via mock shell, which lives under the hidden advanced group (azldev adv is an alias for azldev advanced; it does not appear in azldev --help).

Non-interactive chroot (preferred for agents)

Pipe commands in via a heredoc — fully autonomous, no user interaction needed:

azldev adv mock shell --add-package /path/to/package.rpm <<'CMDS'
<command> --version
echo "exit code: $?"
exit
CMDS

Use this for automated checks: running binaries, querying installed packages, inspecting paths.

Inspect an RPM without installing it

When --add-package fails to install, or you just want to look at an RPM's contents, get the file inside the chroot and inspect it there rather than installing on the host. If the RPM is not already reachable inside the build root, copy it in first with mock --copyin <rpm> /tmp/ (using the project's distro mock config), then:

azldev adv mock shell <<'CMDS'
rpm -qip /tmp/<name>*.rpm    # package info
rpm -qlp /tmp/<name>*.rpm    # file list
rpm -qRp /tmp/<name>*.rpm    # dependencies
dnf install /tmp/<name>*.rpm # retry the install to see the error details
exit
CMDS

This gives you the full distro environment for debugging dependency issues, file conflicts, and failed installs, without touching the host.

Interactive chroot

Use when you need to explore interactively or react to output between commands:

azldev adv mock shell --add-package /path/to/package.rpm --enable-network

When driving an interactive shell as an agent:

  1. Run a simple command (e.g. echo ready) in a foreground terminal to establish a shared shell.
  2. Ask the user to run the azldev adv mock shell command in that same terminal.
  3. Wait for confirmation that they are inside the mock shell.
  4. Run diagnostic commands in the same foreground terminal — they execute inside the chroot.
  5. Run exit to leave the chroot.

Prefer the non-interactive heredoc approach; use interactive only when you must react to output between commands.

Key flags

Flag Purpose
-p, --add-package <path> Install a package into the chroot before entering. Accepts an RPM file path or a package name. May be repeated.
--enable-network Allow network access (dependency resolution, downloads).

-p means --add-package, not a component name. Unlike azldev comp build -p <name>, mock shell has no component selector. -p <name> installs a package by name from the configured repos — it does not set up a chroot with that component's build dependencies.

Gotchas

  • Don't mix -p <name> with --add-package /path/to/<name>.rpm for the same package — that installs both the repo build and your local build, which conflict. Use one or the other.
  • The mock chroot is persistent across azldev adv mock shell sessions — installed packages and created files survive. Handy (install once, re-enter later), but stale state can confuse. azldev has no built-in reset; clear it with mock directly (--scrub=chroot, or --scrub=all to also drop the bootstrap), pointing at the project's distro mock config.
  • One mock session per terminal. Running azldev adv mock shell while a terminal is already inside a mock shell fails — run exit first.

Generated by azldev docs agent; do not hand-edit.

자주 묻는 질문

왜 RPM을 제 컴퓨터에 설치하지 않나요?

스킬은 빌드된 패키지가 사용자 컴퓨터가 아니라 빌드 중인 배포판을 대상으로 한다고 설명합니다.

수동 단계 없이 실행할 수 있나요?

네. 스킬은 명령을 셸에 파이프로 전달하는 비대화형 방법을 설명합니다.

특별한 명령이 필요한가요?

표준 도움말 출력에는 나오지 않는 고급 mock 셸 명령을 사용합니다.

상세 정보

작성자의 원본 설명

Read this before testing or inspecting a built RPM; do not drive mock by hand from memory. Explains how to test and inspect built packages in a mock chroot with 'azldev adv mock shell', covering non-interactive (heredoc) and interactive chroot workflows, the -p/--add-package flag, and resetting stale chroot state. Triggers include test package, mock shell, inspect rpm, smoke test, chroot, verify build output.

repo: microsoft/azurelinux

인기도

GitHub 스타
5.4k
순위
#14964
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬