Add naive inbound and test

This commit is contained in:
世界 2022-08-10 20:19:16 +08:00
parent ccdfab378a
commit b79b19c470
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
23 changed files with 709 additions and 87 deletions

View file

@ -10,6 +10,7 @@ import (
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing/common/debug"
F "github.com/sagernet/sing/common/format"
"github.com/sagernet/sing/common/rw"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
@ -71,7 +72,9 @@ func startDockerContainer(t *testing.T, options DockerOptions) {
if len(options.Bind) > 0 {
hostOptions.Binds = []string{}
for path, internalPath := range options.Bind {
path = filepath.Join("config", path)
if !rw.FileExists(path) {
path = filepath.Join("config", path)
}
path, _ = filepath.Abs(path)
hostOptions.Binds = append(hostOptions.Binds, path+":"+internalPath)
}