Skip to content

Commit

Permalink
feat(containers): improve dx by skipping image pull (#12)
Browse files Browse the repository at this point in the history
* docker inspecting everytime for images

* fixing tests

* minor fix

* minor fix

* removing $

* removing $ from checks library

---------

Co-authored-by: Elad Ben-Israel <eladb@monada.co>
  • Loading branch information
itssubhodiproy and eladb authored Nov 26, 2023
1 parent 2683296 commit dfe3b82
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions containers/workload.sim.w
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,13 @@ pub class Workload_sim impl api.IWorkload {
utils.shell("docker", ["build", "-t", this.imageTag, opts.image], this.appDir);
}
} else {
log("pulling {opts.image}");
utils.shell("docker", ["pull", opts.image], this.appDir);
try {
utils.shell("docker", ["inspect", this.imageTag]);
log("image {this.imageTag} already exists");
} catch {
log("pulling {this.imageTag}");
utils.shell("docker", ["pull", this.imageTag]);
}
}

// remove old container
Expand Down

0 comments on commit dfe3b82

Please sign in to comment.