Maybe it's the code at night. ๐
I have a code like this:
package main
import (
"context"
"fmt"
"os"
"dagger.io/dagger"
)
func main() {
client, err := dagger.Connect(context.Background(), dagger.WithLogOutput(os.Stdout))
if err != nil {
fmt.Println(err)
os.Exit(1)
}
defer client.Close()
_, err = client.Container().From("alpine").Export(context.Background(), "hello.tar")
if err != nil {
fmt.Println(err)
os.Exit(1)
}
}
The intention is I want to export a container that defined from from to an image. And use docker import to import image from tar file to docker like this:
docker import .\hello.tar hello-alpine
And using with docker run -it --rm hello-alpine /bin/sh. Expected to see it can run enter the shell, but it returns error like this:
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/bin/sh": stat /bin/sh: no such file or directory: unknown.
I'm not sure what I miss. T_T
