mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 09:50:01 +00:00
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:
parent
dd7b72ca29
commit
61a5cbab51
1 changed files with 13 additions and 7 deletions
|
|
@ -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`);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue