fix: bun cli launch command fails with locally built images (#282)

## Changes

Fixes `bun cli launch --all` command failing when using locally built
Docker images.

### What changed
- Check local Docker images first before querying Docker Hub in
`checkTagExists`

Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
This commit is contained in:
Ahmad Kaouk 2025-11-10 23:52:45 +01:00 committed by GitHub
parent dd7b72ca29
commit 61a5cbab51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -205,12 +205,18 @@ const registerStorageHubNodes = async (launchedNetwork: LaunchedNetwork): Promis
*/
const checkTagExists = async (tag: string) => {
const cleanTag = tag.trim();
logger.debug(`Checking if image ${cleanTag} is available on Docker Hub`);
const result = await $`docker manifest inspect ${cleanTag}`.nothrow().quiet();
invariant(
result.exitCode === 0,
`❌ Image ${tag} not found.\n Does this image exist?\n Are you logged and have access to the repository?`
);
logger.debug(`Checking if image ${cleanTag} is available locally`);
const localResult = await $`docker image inspect ${cleanTag}`.nothrow().quiet();
logger.success(`Image ${cleanTag} found on Docker Hub`);
if (localResult.exitCode !== 0) {
logger.debug(`Checking if image ${cleanTag} is available on Docker Hub`);
const remoteResult = await $`docker manifest inspect ${cleanTag}`.nothrow().quiet();
invariant(
remoteResult.exitCode === 0,
`❌ Image ${tag} not found.\n Does this image exist?\n Are you logged and have access to the repository?`
);
logger.success(`Image ${cleanTag} found on Docker Hub`);
} else {
logger.success(`Image ${cleanTag} found locally`);
}
};