diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..991abbc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:latest AS builder +COPY . / +WORKDIR / +RUN make + +FROM ubuntu:24.10 +LABEL Description="redis-benchmark-go" +COPY --from=builder /redis-benchmark-go /usr/local/bin + +ENTRYPOINT ["redis-benchmark-go"] +CMD [ "--help" ] \ No newline at end of file diff --git a/redis-bechmark-go.go b/redis-bechmark-go.go index 0c40b2e..8b8fddd 100644 --- a/redis-bechmark-go.go +++ b/redis-bechmark-go.go @@ -2,7 +2,7 @@ package main import ( "context" - tls "crypto/tls" + "crypto/tls" "flag" "fmt" "log" @@ -185,6 +185,7 @@ func main() { username := flag.String("u", "", "Username for Redis Auth.") password := flag.String("a", "", "Password for Redis Auth.") enableTls := flag.Bool("tls", false, "Use TLS connection.") + tlsSkipCertCheck := flag.Bool("tls-skip", false, "Ignore TLS certificate check") jsonOutFile := flag.String("json-out-file", "", "Results file. If empty will not save.") seed := flag.Int64("random-seed", 12345, "random seed to be used.") clients := flag.Uint64("c", 50, "number of clients.") @@ -292,11 +293,12 @@ func main() { alwaysRESP2 = false } if *enableTls { + conf := &tls.Config{ + InsecureSkipVerify: *tlsSkipCertCheck, + } opts.NetDialer = &tls.Dialer{ NetDialer: nil, - Config: &tls.Config{ - ServerName: *host, - }, + Config: conf, } }