Skip to content

feat: If the container exists, no pull is performed to speed up program execution #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions sandbox/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ func main() {
log.Printf("Running in dev mode; container published to host at: http://localhost:8080/")
log.Printf("Run a binary with: curl -v --data-binary @/home/bradfitz/hello http://localhost:8080/run\n")
} else {
if out, err := exec.Command("docker", "pull", *container).CombinedOutput(); err != nil {
log.Fatalf("error pulling %s: %v, %s", *container, err, out)
if _, err := exec.Command("docker", "images", "-q", *container).CombinedOutput(); err != nil {
if out, err := exec.Command("docker", "pull", *container).CombinedOutput(); err != nil {
log.Fatalf("error pulling %s: %v, %s", *container, err, out)
}
}
log.Printf("Listening on %s", *listenAddr)
}
Expand Down