Migrate Podman Containerfile
Convert one Podman-oriented build file into the canonical Dockerfile expected
by Discovery catalog tools. Ordinary Containerfiles use Dockerfile syntax, so a
plain file is normally a rename. Podman's .in preprocessing and multi-file
build behavior are not safe filename-only conversions.
Input
Accept exactly one repository-relative source path under agents/ or
starter-kits/. Prefer a path supplied after the slash command:
/migrate-podman-containerfile agents/example/tools/example/Containerfile
If no path is supplied, enumerate changed files in those roots and compare
basenames case-insensitively. Include Containerfile, names beginning with
Containerfile., ending with .Containerfile, or containing .Containerfile.;
also include the corresponding Dockerfile variants when they end in .in.
Continue only when exactly one candidate exists; otherwise list the candidates
and stop without changing files.
Safety gates
Before writing anything:
- Resolve the repository root with
git rev-parse --show-toplevel and ensure
the source remains inside agents/ or starter-kits/.
- Set the destination to
Dockerfile in the source directory.
- Stop if the destination already exists. Never overwrite or merge it
automatically.
- Stop if the source name ends in
.in, contains C-preprocessor directives
such as #include, #define, or #if, or depends on included fragments.
- Search the containing catalog item for references to the source name,
repeated
podman build -f/--file options, generated Containerfiles, or
Podman-specific build/runtime flags. A single literal -f Containerfile
reference is mechanical; variables, generated paths, multiple build files,
or unclear semantics are not.
- Inspect Dockerfile instructions. Standard instructions are
ADD, ARG,
CMD, COPY, ENTRYPOINT, ENV, EXPOSE, FROM, HEALTHCHECK, LABEL,
MAINTAINER, ONBUILD, RUN, SHELL, STOPSIGNAL, USER, VOLUME, and
WORKDIR. Stop on unknown instructions or a non-Docker syntax frontend.
- Identify the effective build-context directory; stop if it cannot be
determined or contains
.containerignore. Docker does not read that file.
Require manual migration of its exclusions to Docker's effective ignore
file, resolving any existing .dockerignore or Dockerfile-specific ignore
file, before retrying.
When a safety gate fails, make no changes. Explain the exact blocker and point
to docs/authoring-guides/podman-to-docker-migration.md, including the manual
steps relevant to that blocker. Do not produce a best-effort Dockerfile.
Safe migration
When every safety gate passes:
Rename the source to the adjacent canonical destination with
git mv <source> <directory>/Dockerfile.
Update only exact, literal references to the old filename within the same
catalog item. Replace them with Dockerfile. If a reference requires shell
evaluation or changes build semantics, undo no user work; stop and report
that manual migration is required.
Preserve file bytes, line endings, instruction order, comments, and parser
directives. Do not opportunistically rewrite package commands or base
images.
Confirm no Podman build filename remains in the migrated tool directory and
inspect git diff -- <catalog-item>.
If Docker with Buildx is available, run a syntax-only check:
docker buildx build --check --file Dockerfile .
Run it from the tool directory. Do not run a full image build unless the
user explicitly asks. If Docker/Buildx is unavailable, report the check as
not run rather than treating that as success.
Run the repository's focused POL-022 test or PR validator when available.
Result
Report:
- source and destination paths;
- whether the conversion was a byte-preserving rename;
- any exact references updated;
- Docker syntax-check command and result, or why it was not run;
- remaining manual validation, if any.
Success requires a tracked Dockerfile and no obsolete Containerfile in the
migrated tool directory.
1---2name: migrate-podman-containerfile3description: 'Migrate a Podman Containerfile to the canonical Dockerfile required by the Discovery catalog. Use when a PR fails POL-022, a tool contains Containerfile or Dockerfile.in, or a contributor asks to convert Podman build files for Docker. Creates the Dockerfile directly only when the migration is mechanically safe and refuses ambiguous preprocessing or multi-file builds.'4argument-hint: '<path-to-Containerfile>'5allowed-tools: shell6metadata:7 source: https://skillmd.com/skills/microsoft/migrate-podman-containerfile8---910# Migrate Podman Containerfile1112Convert one Podman-oriented build file into the canonical `Dockerfile` expected13by Discovery catalog tools. Ordinary Containerfiles use Dockerfile syntax, so a14plain file is normally a rename. Podman's `.in` preprocessing and multi-file15build behavior are not safe filename-only conversions.1617## Input1819Accept exactly one repository-relative source path under `agents/` or20`starter-kits/`. Prefer a path supplied after the slash command:2122```text23/migrate-podman-containerfile agents/example/tools/example/Containerfile24```2526If no path is supplied, enumerate changed files in those roots and compare27basenames case-insensitively. Include `Containerfile`, names beginning with28`Containerfile.`, ending with `.Containerfile`, or containing `.Containerfile.`;29also include the corresponding `Dockerfile` variants when they end in `.in`.30Continue only when exactly one candidate exists; otherwise list the candidates31and stop without changing files.3233## Safety gates3435Before writing anything:36371. Resolve the repository root with `git rev-parse --show-toplevel` and ensure38 the source remains inside `agents/` or `starter-kits/`.392. Set the destination to `Dockerfile` in the source directory.403. Stop if the destination already exists. Never overwrite or merge it41 automatically.424. Stop if the source name ends in `.in`, contains C-preprocessor directives43 such as `#include`, `#define`, or `#if`, or depends on included fragments.445. Search the containing catalog item for references to the source name,45 repeated `podman build -f/--file` options, generated Containerfiles, or46 Podman-specific build/runtime flags. A single literal `-f Containerfile`47 reference is mechanical; variables, generated paths, multiple build files,48 or unclear semantics are not.496. Inspect Dockerfile instructions. Standard instructions are `ADD`, `ARG`,50 `CMD`, `COPY`, `ENTRYPOINT`, `ENV`, `EXPOSE`, `FROM`, `HEALTHCHECK`, `LABEL`,51 `MAINTAINER`, `ONBUILD`, `RUN`, `SHELL`, `STOPSIGNAL`, `USER`, `VOLUME`, and52 `WORKDIR`. Stop on unknown instructions or a non-Docker syntax frontend.537. Identify the effective build-context directory; stop if it cannot be54 determined or contains `.containerignore`. Docker does not read that file.55 Require manual migration of its exclusions to Docker's effective ignore56 file, resolving any existing `.dockerignore` or Dockerfile-specific ignore57 file, before retrying.5859When a safety gate fails, make no changes. Explain the exact blocker and point60to `docs/authoring-guides/podman-to-docker-migration.md`, including the manual61steps relevant to that blocker. Do not produce a best-effort Dockerfile.6263## Safe migration6465When every safety gate passes:66671. Rename the source to the adjacent canonical destination with68 `git mv <source> <directory>/Dockerfile`.692. Update only exact, literal references to the old filename within the same70 catalog item. Replace them with `Dockerfile`. If a reference requires shell71 evaluation or changes build semantics, undo no user work; stop and report72 that manual migration is required.733. Preserve file bytes, line endings, instruction order, comments, and parser74 directives. Do not opportunistically rewrite package commands or base75 images.764. Confirm no Podman build filename remains in the migrated tool directory and77 inspect `git diff -- <catalog-item>`.785. If Docker with Buildx is available, run a syntax-only check:7980 ```console81 docker buildx build --check --file Dockerfile .82 ```8384 Run it from the tool directory. Do not run a full image build unless the85 user explicitly asks. If Docker/Buildx is unavailable, report the check as86 not run rather than treating that as success.876. Run the repository's focused POL-022 test or PR validator when available.8889## Result9091Report:9293- source and destination paths;94- whether the conversion was a byte-preserving rename;95- any exact references updated;96- Docker syntax-check command and result, or why it was not run;97- remaining manual validation, if any.9899Success requires a tracked `Dockerfile` and no obsolete Containerfile in the100migrated tool directory.