Skip to content

Commit d221d45

Browse files
authored
Bug fix: Use cli tag for docker image (github#247)
* Use cli tag for docker image. * Skip build for poci. * Ensure poci image can be pulled.
1 parent f37b022 commit d221d45

3 files changed

Lines changed: 41 additions & 1 deletion

File tree

cmd/build/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ func run(ctx context.Context, name string, listTools bool, pullCommunity bool) e
4848
return nil
4949
}
5050

51+
if server.Type == "poci" {
52+
fmt.Printf("✅ Build skipped for poci server %s\n", name)
53+
return nil
54+
}
55+
5156
isMcpImage := strings.HasPrefix(server.Image, "mcp/")
5257

5358
if isMcpImage {

cmd/validate/main.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"log"
1010
"net/http"
1111
"os"
12+
"os/exec"
1213
"path/filepath"
1314
"regexp"
1415
"strings"
@@ -64,6 +65,10 @@ func run(name string) error {
6465
return err
6566
}
6667

68+
if err := isPociValid(name); err != nil {
69+
return err
70+
}
71+
6772
return nil
6873
}
6974

@@ -344,3 +349,33 @@ func readToolsJson(name string) ([]mcp.Tool, error) {
344349

345350
return tools, nil
346351
}
352+
353+
func isPociValid(name string) error {
354+
server, err := readServerYaml(name)
355+
if err != nil {
356+
return err
357+
}
358+
359+
if server.Type != "poci" {
360+
return nil
361+
}
362+
363+
for _, tool := range server.Tools {
364+
if tool.Container.Image != "" {
365+
if err := pullPociImage(tool.Container.Image); err != nil {
366+
fmt.Printf("🛑 Could not pull poci image %s: %v\n", tool.Container.Image, err)
367+
return err
368+
}
369+
}
370+
}
371+
372+
fmt.Println("✅ Poci image is valid")
373+
return nil
374+
}
375+
376+
func pullPociImage(image string) error {
377+
cmd := exec.Command("docker", "pull", image)
378+
cmd.Stdout = os.Stdout
379+
cmd.Stderr = os.Stderr
380+
return cmd.Run()
381+
}

servers/docker/server.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ tools:
2222
required:
2323
- args
2424
container:
25-
image: docker
25+
image: docker:cli
2626
command:
2727
- '{{args|into}}'
2828
volumes:

0 commit comments

Comments
 (0)