diff --git a/contrib/httpserver/Dockerfile b/contrib/httpserver/Dockerfile deleted file mode 100644 index 747dc91bcf..0000000000 --- a/contrib/httpserver/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM busybox -EXPOSE 80/tcp -COPY httpserver . -CMD ["./httpserver"] diff --git a/contrib/httpserver/server.go b/contrib/httpserver/server.go deleted file mode 100644 index 74e60b06df..0000000000 --- a/contrib/httpserver/server.go +++ /dev/null @@ -1,12 +0,0 @@ -package main - -import ( - "log" - "net/http" -) - -func main() { - fs := http.FileServer(http.Dir("/static")) - http.Handle("/", fs) - log.Panic(http.ListenAndServe(":80", nil)) // #nosec G114 -- Ignoring for test-code: G114: Use of net/http serve function that has no support for setting timeouts (gosec) -} diff --git a/testutil/fakestorage/fixtures.go b/testutil/fakestorage/fixtures.go index 745468a137..ca0f2b3820 100644 --- a/testutil/fakestorage/fixtures.go +++ b/testutil/fakestorage/fixtures.go @@ -40,7 +40,24 @@ func ensureHTTPServerImage(t testing.TB) { assert.NilError(t, err, "could not find go executable to build http server") tmp := t.TempDir() - cmd := exec.Command(goCmd, "build", "-o", filepath.Join(tmp, "httpserver"), "../contrib/httpserver") + const httpServer = `package main + +import ( + "log" + "net/http" +) + +func main() { + fs := http.FileServer(http.Dir("/static")) + http.Handle("/", fs) + log.Panic(http.ListenAndServe(":80", nil)) // #nosec G114 -- Ignoring for test-code: G114: Use of net/http serve function that has no support for setting timeouts (gosec) +} +` + src := filepath.Join(tmp, "main.go") + err = os.WriteFile(filepath.Join(tmp, "main.go"), []byte(httpServer), 0o0644) + assert.NilError(t, err) + + cmd := exec.Command(goCmd, "build", "-o", filepath.Join(tmp, "httpserver"), src) cmd.Env = append(os.Environ(), []string{ "CGO_ENABLED=0", "GOOS=" + goos,