Skip to content

Commit 1b7897d

Browse files
authored
fix: removes deprecated docker-compose in favour of docker compose (#267)
1 parent 9ff8171 commit 1b7897d

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ For details and locally tweaking the configuration refer to [@recommended-conf](
167167

168168
In order to individually monitor envoy logs while performing requests, in another terminal you can run:
169169

170-
- Envoy logs: `docker-compose -f ./example/envoy/docker-compose.yml logs -f envoy-logs`.
171-
- Critical wasm (audit) logs: `docker-compose -f ./example/envoy/docker-compose.yml logs -f wasm-logs`
170+
- Envoy logs: `docker compose -f ./example/envoy/docker-compose.yml logs -f envoy-logs`.
171+
- Critical wasm (audit) logs: `docker compose -f ./example/envoy/docker-compose.yml logs -f wasm-logs`
172172

173173
The Envoy example comes also with a Grafana dashboard that can be accessed at `localhost:3000` (admin/admin) in order to monitor the memory consumption.
174174

magefiles/loadtest.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ func LoadTest() error {
2929
}
3030

3131
func doLoadTest(conf string, payloadSize int, threads int) error {
32-
if err := sh.RunV("docker-compose", "--file", "ftw/docker-compose.yml", "build", "--pull"); err != nil {
32+
if err := sh.RunV("docker", "compose", "--file", "ftw/docker-compose.yml", "build", "--pull"); err != nil {
3333
return err
3434
}
3535
defer func() {
36-
_ = sh.RunV("docker-compose", "--file", "ftw/docker-compose.yml", "kill")
37-
_ = sh.RunV("docker-compose", "--file", "ftw/docker-compose.yml", "down", "-v")
36+
_ = sh.RunV("docker", "compose", "--file", "ftw/docker-compose.yml", "kill")
37+
_ = sh.RunV("docker", "compose", "--file", "ftw/docker-compose.yml", "down", "-v")
3838
}()
39-
if err := sh.RunWithV(map[string]string{"ENVOY_CONFIG": fmt.Sprintf("/conf/%s", conf)}, "docker-compose",
39+
if err := sh.RunWithV(map[string]string{"ENVOY_CONFIG": fmt.Sprintf("/conf/%s", conf)}, "docker", "compose",
4040
"--file", "ftw/docker-compose.yml", "run", "--service-ports", "--rm", "-d", "envoy"); err != nil {
4141
return err
4242
}

magefiles/magefile.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,14 @@ func Build() error {
223223
return patchWasm(filepath.Join("build", "mainraw.wasm"), filepath.Join("build", "main.wasm"), initialPages)
224224
}
225225

226-
// E2e runs e2e tests with a built plugin against the example deployment. Requires docker-compose.
226+
// E2e runs e2e tests with a built plugin against the example deployment. Requires docker.
227227
func E2e() error {
228228
var err error
229-
if err = sh.RunV("docker-compose", "--file", "e2e/docker-compose.yml", "up", "-d", "envoy"); err != nil {
229+
if err = sh.RunV("docker", "compose", "--file", "e2e/docker-compose.yml", "up", "-d", "envoy"); err != nil {
230230
return err
231231
}
232232
defer func() {
233-
_ = sh.RunV("docker-compose", "--file", "e2e/docker-compose.yml", "down", "-v")
233+
_ = sh.RunV("docker", "compose", "--file", "e2e/docker-compose.yml", "down", "-v")
234234
}()
235235

236236
envoyHost := os.Getenv("ENVOY_HOST")
@@ -245,18 +245,18 @@ func E2e() error {
245245
// --nulled-body is needed because coraza-proxy-wasm returns a 200 OK with a nulled body when if the interruption happens after phase 3
246246
if err = sh.RunV("go", "run", "github.com/corazawaf/coraza/v3/http/e2e/cmd/httpe2e@main", "--proxy-hostport",
247247
"http://"+envoyHost, "--httpbin-hostport", "http://"+httpbinHost, "--nulled-body"); err != nil {
248-
sh.RunV("docker-compose", "-f", "e2e/docker-compose.yml", "logs", "envoy")
248+
sh.RunV("docker", "compose", "-f", "e2e/docker-compose.yml", "logs", "envoy")
249249
}
250250
return err
251251
}
252252

253-
// Ftw runs ftw tests with a built plugin and Envoy. Requires docker-compose.
253+
// Ftw runs ftw tests with a built plugin and Envoy. Requires docker.
254254
func Ftw() error {
255-
if err := sh.RunV("docker-compose", "--file", "ftw/docker-compose.yml", "build", "--pull"); err != nil {
255+
if err := sh.RunV("docker", "compose", "--file", "ftw/docker-compose.yml", "build", "--pull"); err != nil {
256256
return err
257257
}
258258
defer func() {
259-
_ = sh.RunV("docker-compose", "--file", "ftw/docker-compose.yml", "down", "-v")
259+
_ = sh.RunV("docker", "compose", "--file", "ftw/docker-compose.yml", "down", "-v")
260260
}()
261261
env := map[string]string{
262262
"FTW_CLOUDMODE": os.Getenv("FTW_CLOUDMODE"),
@@ -270,22 +270,22 @@ func Ftw() error {
270270
if os.Getenv("MEMSTATS") == "true" {
271271
task = "ftw-memstats"
272272
}
273-
return sh.RunWithV(env, "docker-compose", "--file", "ftw/docker-compose.yml", "run", "--rm", task)
273+
return sh.RunWithV(env, "docker", "compose", "--file", "ftw/docker-compose.yml", "run", "--rm", task)
274274
}
275275

276-
// RunEnvoyExample spins up the test environment of envoy, access at http://localhost:8080. Requires docker-compose.
276+
// RunEnvoyExample spins up the test environment of envoy, access at http://localhost:8080. Requires docker.
277277
func RunEnvoyExample() error {
278-
return sh.RunWithV(map[string]string{"ENVOY_IMAGE": os.Getenv("ENVOY_IMAGE")}, "docker-compose", "--file", "example/envoy/docker-compose.yml", "up")
278+
return sh.RunWithV(map[string]string{"ENVOY_IMAGE": os.Getenv("ENVOY_IMAGE")}, "docker", "compose", "--file", "example/envoy/docker-compose.yml", "up")
279279
}
280280

281-
// TeardownEnvoyExample tears down the test environment of envoy. Requires docker-compose.
281+
// TeardownEnvoyExample tears down the test environment of envoy. Requires docker.
282282
func TeardownEnvoyExample() error {
283-
return sh.RunV("docker-compose", "--file", "example/envoy/docker-compose.yml", "down")
283+
return sh.RunV("docker", "compose", "--file", "example/envoy/docker-compose.yml", "down")
284284
}
285285

286-
// ReloadEnvoyExample reload the test environment (container) of envoy in case of envoy or wasm update. Requires docker-compose
286+
// ReloadEnvoyExample reload the test environment (container) of envoy in case of envoy or wasm update. Requires docker.
287287
func ReloadEnvoyExample() error {
288-
return sh.RunV("docker-compose", "--file", "example/envoy/docker-compose.yml", "restart")
288+
return sh.RunV("docker", "compose", "--file", "example/envoy/docker-compose.yml", "restart")
289289
}
290290

291291
var Default = Build

0 commit comments

Comments
 (0)