Skip to main content

BaseImage

Struct BaseImage 

Source
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: String

Goes into baseImageArn — the platform’s managed base, not a registry ref.

§docker_ref: String

Goes into the Dockerfile FROM — the registry ref measured alongside name.

§working_dir: String

What 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

Source

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.

Source

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.

Source

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§

Source§

impl Clone for BaseImage

Source§

fn clone(&self) -> BaseImage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BaseImage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for BaseImage

Source§

fn default() -> BaseImage

Returns the “default value” for a type. Read more
Source§

impl Eq for BaseImage

Source§

impl PartialEq for BaseImage

Source§

fn eq(&self, other: &BaseImage) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BaseImage

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more