pub struct BaseImage {
pub name: String,
pub docker_ref: String,
pub working_dir: String,
}Expand description
A base image: the platform ARN, the Dockerfile FROM that pairs with it, and whether
it declares a WORKDIR.
All three together because the first two must agree and used to be able to
disagree: the Python client’s DEFAULT_BASE_IMAGE named the managed base for
baseImageArn while default_dockerfile hardcoded an unrelated registry literal in
its FROM, so changing either left the other pointing somewhere else
(sandbox.py:410-444). Pairing them means a caller selects one thing and both fields
follow.
Fields§
§name: StringGoes into baseImageArn — the platform’s managed base, not a registry ref.
docker_ref: StringGoes into the Dockerfile FROM — the registry ref measured alongside name.
working_dir: StringWhat docker inspect reports for WorkingDir. Empty means it declares none.
A field rather than a lookup because a caller with a purpose-built image is the only one who can say what their image declares, and this client cannot read it without pulling the manifest.
Implementations§
Source§impl BaseImage
impl BaseImage
Sourcepub fn al2023() -> BaseImage
pub fn al2023() -> BaseImage
The managed base every docs/PLATFORM.md measurement from 2026-08-06 onward used,
paired with the registry ref those same builds used as FROM.
working_dir is empty, and that is measured rather than assumed:
al2023-minimal, python:3.12-slim, and node:20-slim all leave WorkingDir
empty (2026-08-05), which is what makes require_workdir necessary.
Sourcepub fn from_dockerfile(dockerfile: &str) -> Result<BaseImage, Error>
pub fn from_dockerfile(dockerfile: &str) -> Result<BaseImage, Error>
The base image a task Dockerfile pairs with: the managed base’s name (so
baseImageArn is unchanged) and the Dockerfile’s own first FROM as docker_ref
(IMAGE-4).
§The pairing the other way round
require_matching_from refuses a Dockerfile whose first FROM is not the base’s
docker_ref. That is the right guard where this client derives the Dockerfile from
the base; a task Dockerfile chooses its own FROM, so the pairing has to run from the
Dockerfile to the base, and every harness wrote the same inversion by hand (#220).
Here the ref is taken whole — --platform and AS decoration dropped by
dockerfile_from_ref, a digest pin kept — so the guard’s comparison is the ref
against itself and it passes by construction.
working_dir is empty: this cannot read the FROM image’s WorkingDir without
pulling its manifest, and empty is what every measured public base declares (see
BaseImage::al2023). A task that relies on one sets WORKDIR, which
require_workdir reads from the Dockerfile.
Refuses a Dockerfile with no FROM: there is no ref to take.
Sourcepub fn arn(&self, region: &Region) -> String
pub fn arn(&self, region: &Region) -> String
The baseImageArn for this base in region.
§microvm-image:<name>, with a colon, and it is not just the managed base
This was the only place in the repo building the colon form; the fakes and the
encoding test all used microvm-image/<name>, so the repo held two beliefs about the
shape of the identifier every image call takes. The model’s TaggableResource pattern
admits only (capacity-provider|network-connector|microvm-image):[a-zA-Z0-9-_]+, and
a live read settled it: ListMicrovmImages in us-east-1 returns
arn:aws:lambda:us-east-1:<account>:microvm-image:coding-agents-on-bedrock for a
customer image, and GetMicrovmImage accepts exactly that (measured 2026-08-15).
So the colon is right for both the managed base and a customer image; there is no
two-form rule, and this comment used to imply there was. The slash form fails as
AccessDeniedException rather than as a validation error, because IAM evaluates the
malformed ARN as a resource with no matching policy — a permissions message for a
resource that exists.
Trait Implementations§
impl Eq for BaseImage
impl StructuralPartialEq for BaseImage
Auto Trait Implementations§
impl Freeze for BaseImage
impl RefUnwindSafe for BaseImage
impl Send for BaseImage
impl Sync for BaseImage
impl Unpin for BaseImage
impl UnsafeUnpin for BaseImage
impl UnwindSafe for BaseImage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more