Skip to content

emu-docker create: add --name flag to override generated image name#410

Merged
jpcottin merged 1 commit into
google:masterfrom
jpcottin:feat/emu-docker-name-flag
May 16, 2026
Merged

emu-docker create: add --name flag to override generated image name#410
jpcottin merged 1 commit into
google:masterfrom
jpcottin:feat/emu-docker-name-flag

Conversation

@jpcottin
Copy link
Copy Markdown
Collaborator

Why

emu-docker create auto-generates image names like 36-google-x64-ps16k from system image properties. Sensible default, but doesn't fit deployments that have their own image-naming convention (e.g., prod-emu-android16, or matching an internal registry's path layout).

Change

Adds a --name flag to emu-docker create that overrides the auto-generated image name. When unset, behavior is unchanged.

emu-docker create stable "Q google_apis x86_64" --name my-custom-image-name

Credit

Rebase + extraction of @gregersn's #359, which bundled this with an unrelated ANDROID_REPOSITORY env-var feature. Splitting into two PRs (this one + a follow-up for the repository override). Original commit authored 2021-11-04; preserved here as Author: Greger Stolt Nilsen <greger@fusetools.com> via cherry-pick onto current master. No code changes from the original — clean cherry-pick, no rebase conflicts.

Test plan

  • All 42 existing unit tests pass (pytest tests/ --ignore=tests/e2e) on the cherry-picked commit
  • emu-docker create --help lists --name NAME Name to give image when pushed.
  • EmulatorContainer.image_name() returns the override when self.name is set
  • name=None (the default) preserves the existing <sdk>-<tag>-<cpu> auto-generation path (covered by existing unit tests)
  • CI from ci: add GitHub Actions workflow to run pytest on PRs #405 reruns the matrix (Python 3.10/3.11/3.12/3.13)

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 16, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Adds a --name flag to `emu-docker create` that overrides the
auto-generated image name (which is otherwise built from
<sdk>-<tag>-<cpu>). Useful for deployments with their own naming
conventions, e.g. matching an internal registry's path layout.

When unset, behavior is unchanged.

Original implementation by Greger Stolt Nilsen from google#359;
cherry-picked onto current master here.
@jpcottin jpcottin force-pushed the feat/emu-docker-name-flag branch from 71818ff to 155e061 Compare May 16, 2026 21:52
@jpcottin jpcottin merged commit 8e2d3c5 into google:master May 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant