func runRegistry(t *testing.T) *httptest.Server {
	regHandler := registry.New()
	regSrv := httptest.NewServer(regHandler)
	host := regSrv.URL[len("http://"):]
	println("Registry server: ", regSrv.URL)
	files, err := filepath.Glob("testfiles/*.tar")
	assert.NoError(t, err)
	for _, file := range files {
		img, err := crane.Load(file)
		imageName := filepath.Base(file[:len(file)-len(".tar")]) + ":v1"
		assert.NoError(t, err)
		assert.NoError(t, crane.Push(img, host+"/"+imageName))
		println("Uploaded", imageName)
	}
	return regSrv
}
Run an image registry, loading any tar files that are in testfiles/
package tests
import (
	"io/ioutil"
	"net/http/httptest"
	"os"
	"path/filepath"
	"sort"
	"testing"
	"github.com/google/go-containerregistry/pkg/crane"
	"github.com/google/go-containerregistry/pkg/registry"
	"github.com/stretchr/testify/assert"
	"github.com/jkcfg/jk/pkg/test"
)
func listTestFiles(t *testing.T) []string {
	cmds, err := filepath.Glob("test-*.js.cmd")
	assert.NoError(t, err)
	files, err := filepath.Glob("test-*.js")
	assert.NoError(t, err)
	for _, cmd := range cmds {
		files = append(files, cmd[:len(cmd)-4])
	}
	unique := make(map[string]struct{})
	for _, key := range files {
		unique[key] = struct{}{}
	}
	files = make([]string, 0, len(unique))
	for key := range unique {
		files = append(files, key)
	}
	sort.Strings(files)
	return files
}