dockerimg: switch to a debian base image
Developing on a musl-based alpine image seems to suck.
A lot of python stuff doesn't work.
Even when told it's alpine, LLMs still want to apt-get install things.
Along with switching to debian, simplify everything.
We *always* use debian bookwork now. If there are python
things, the LLM needs to install them on top of the model.
This will make fallback mode easier: if a build fails, then we
drop ExtraCmds and try again. (Future work.)
While here: avoid using docker buildx in tests because
it seems to vary a lot version-to-version.
diff --git a/dockerimg/pushdockerimg.go b/dockerimg/pushdockerimg.go
index 2647626..cd9e543 100644
--- a/dockerimg/pushdockerimg.go
+++ b/dockerimg/pushdockerimg.go
@@ -19,7 +19,7 @@
}
defer os.RemoveAll(dir)
- name, dockerfile, hash := dockerimg.DefaultImage()
+ name, dockerfile, tag := dockerimg.DefaultImage()
if err := os.WriteFile(filepath.Join(dir, "Dockerfile"), []byte(dockerfile), 0o666); err != nil {
panic(err)
}
@@ -40,23 +40,24 @@
}
}
+ path := name + ":" + tag
+
run("colima", "start")
run("docker", "buildx", "create", "--name", "arm", "--use", "--driver", "docker-container", "--bootstrap")
run("docker", "buildx", "use", "arm")
- run("docker", "buildx", "build", "--platform", "linux/arm64", "-t", name+"arm64", "--push", ".")
+ run("docker", "buildx", "build", "--platform", "linux/arm64", "-t", path+"arm64", "--push", ".")
run("docker", "buildx", "rm", "arm")
run("colima", "start", "--profile=intel", "--arch=x86_64", "--vm-type=vz", "--vz-rosetta", "--memory=4", "--disk=15")
run("docker", "context", "use", "colima-intel")
run("docker", "buildx", "create", "--name", "intel", "--use", "--driver", "docker-container", "--bootstrap")
run("docker", "buildx", "use", "intel")
- run("docker", "buildx", "build", "--platform", "linux/amd64", "-t", name+"amd64", "--push", ".")
+ run("docker", "buildx", "build", "--platform", "linux/amd64", "-t", path+"amd64", "--push", ".")
run("docker", "buildx", "rm", "intel")
run("docker", "context", "use", "colima")
run("colima", "stop", "--profile=intel")
run(
"docker", "buildx", "imagetools", "create",
- "--annotation", "index:org.opencontainers.image.revision="+hash,
- "-t", name, name+"arm64", name+"amd64",
+ "-t", path, path+"arm64", path+"amd64",
)
- run("docker", "buildx", "imagetools", "inspect", name)
+ run("docker", "buildx", "imagetools", "inspect", path)
}