mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
![Vincent Demeester](/assets/img/avatar_default.png)
- Move go package used by both `integration-cli` and `integration` to `internal/test/fixtures`. - Remove fixtures that are not used anymore (moved to `docker/cli` a while ago) : deploy, notary, secrets. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
34 lines
691 B
Go
34 lines
691 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net"
|
|
"net/http"
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
func main() {
|
|
p, err := filepath.Abs(filepath.Join("run", "docker", "plugins"))
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if err := os.MkdirAll(p, 0755); err != nil {
|
|
panic(err)
|
|
}
|
|
l, err := net.Listen("unix", filepath.Join(p, "basic.sock"))
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
mux := http.NewServeMux()
|
|
server := http.Server{
|
|
Addr: l.Addr().String(),
|
|
Handler: http.NewServeMux(),
|
|
}
|
|
mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) {
|
|
w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1.1+json")
|
|
fmt.Println(w, `{"Implements": ["dummy"]}`)
|
|
})
|
|
server.Serve(l)
|
|
}
|