INNER CODE UNIT · Go

isContainerManifest

container2wasm/container2wasm · cmd/create-spec/main.go:204

func isContainerManifest(manifest ocispec.Manifest) bool {
	if !images.IsConfigType(manifest.Config.MediaType) {
		return false
	}
	for _, desc := range manifest.Layers {
		if !images.IsLayerType(desc.MediaType) {
			return false
		}
	}
	return true
}

func unpackDocker(ctx context.Context, imgDir string, platform *ocispec.Platform, rootfs string) (io.Reader, error) {
	fmt.Println("Trying to unpack image as a docker image")
	if rootfs == "" {
		return nil, fmt.Errorf("specify rootfs")
	}
	mfstsR, err := os.Open(filepath.Join(imgDir, "manifest.json"))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…