Skip to content

Commit ed7101d

Browse files
committed
docs: update Docker commands for consistency and simplification
1 parent 3c001f2 commit ed7101d

File tree

14 files changed

+46
-75
lines changed

14 files changed

+46
-75
lines changed

docs/contract_driven_development/generating_api_specifications.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ OR
2525

2626
Using docker:
2727
```shell
28-
docker run -p 9000:9000 -v "$PWD/specification:/specification" specmatic/specmatic proxy --target=https://dummyjson.com /specification
28+
docker run -p 9000:9000 -v "$(pwd)/specification:/specification" specmatic/specmatic proxy --target=https://dummyjson.com /specification
2929
```
3030

3131
You will get following confirmation message: <br /> `Proxy server is running on http://localhost:9000. Ctrl + C to stop.`

docs/supported_protocols/arazzo.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ In Specmatic Studio, you can start a mock workflow session to simulate end-to-en
182182
You can also run workflow mocking through the CLI using the mock command from the Specmatic-Arazzo Docker image:
183183

184184
```shell
185-
docker run -v "$(pwd):/usr/src/app" specmatic/enterprise mock --spec-file "<workflow.arazzo.yaml>"
185+
docker run --network host -v "$(pwd):/usr/src/app" specmatic/enterprise mock --spec-file "<workflow.arazzo.yaml>"
186186
```
187187

188188
## Sample Projects

docs/supported_protocols/asyncapi/active-mq.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Start your application that implements the AsyncAPI specification. The applicati
145145
Execute the contract tests using the Specmatic Docker image:
146146

147147
```bash
148-
docker run --network host -v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" -v "$PWD/spec:/usr/src/app/spec" specmatic/enterprise test
148+
docker run --network host -v "$(pwd):/usr/src/app" specmatic/enterprise test
149149
```
150150

151151
Specmatic-async will:

docs/supported_protocols/asyncapi/aws-event-bridge.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ Start your application that implements the AsyncAPI specification. The applicati
228228
Execute the contract tests using the Specmatic Docker image:
229229

230230
```bash
231-
docker run --network host -v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" -v "$PWD/spec:/usr/src/app/spec" specmatic/enterprise test
231+
docker run --network host -v "$(pwd):/usr/src/app" specmatic/enterprise test
232232
```
233233

234234
Specmatic-async will:

docs/supported_protocols/asyncapi/aws-sns.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ Start your application that implements the AsyncAPI specification. The applicati
212212
Execute the contract tests using the Specmatic Docker image:
213213

214214
```bash
215-
docker run --network host -v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" -v "$PWD/spec:/usr/src/app/spec" specmatic/enterprise test
215+
docker run --network host -v "$(pwd):/usr/src/app" specmatic/enterprise test
216216
```
217217

218218
Specmatic-async will:

docs/supported_protocols/asyncapi/aws-sqs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Start your application that implements the AsyncAPI specification. The applicati
135135
Execute the contract tests using the Specmatic Docker image:
136136

137137
```bash
138-
docker run --network host -v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" -v "$PWD/spec:/usr/src/app/spec" specmatic/enterprise test
138+
docker run --network host -v "$(pwd):/usr/src/app" specmatic/enterprise test
139139
```
140140

141141
Specmatic-async will:

docs/supported_protocols/asyncapi/index.mdx

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@ To help you verify the above with a No-Code approach, Specmatic will send exampl
3737
Basic run:
3838

3939
```bash
40-
docker run --rm --network host \
41-
-v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" \
42-
-v "$PWD/spec:/usr/src/app/spec" \
43-
-v "$PWD/build/reports/specmatic:/usr/src/app/build/reports/specmatic" \
44-
specmatic/enterprise test
40+
docker run --rm --network host -v "$(pwd):/usr/src/app" specmatic/enterprise test
4541
```
4642

4743
### Key Capabilities
@@ -246,11 +242,7 @@ Replace values in angle brackets (`<...>`) with your actual configuration.
246242
Start your application with its dependencies (SQS, Kafka, etc.), then run:
247243

248244
```bash
249-
docker run --rm --network host \
250-
-v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" \
251-
-v "$PWD/spec:/usr/src/app/spec" \
252-
-v "$PWD/build/reports/specmatic:/usr/src/app/build/reports/specmatic" \
253-
specmatic/enterprise test
245+
docker run --rm --network host -v "$(pwd):/usr/src/app" specmatic/enterprise test
254246
```
255247

256248
This generates and executes contract tests based on your AsyncAPI specification.
@@ -346,11 +338,7 @@ contracts:
346338
**Step 3: Start the Mock**
347339

348340
```bash
349-
docker run --rm --network host \
350-
-v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" \
351-
-v "$PWD/spec:/usr/src/app/spec" \
352-
-v "$PWD/build/reports/specmatic:/usr/src/app/build/reports/specmatic" \
353-
specmatic/enterprise virtualize
341+
docker run --rm --network host -v "$(pwd):/usr/src/app" specmatic/enterprise mock
354342
```
355343

356344
**How It Works**:
@@ -370,7 +358,7 @@ For examples in `<SPEC_NAME>_examples/` directory:
370358

371359
```bash
372360
docker run --rm \
373-
-v "$PWD/spec:/usr/src/app/spec" \
361+
-v "$(pwd):/usr/src/app" \
374362
specmatic/enterprise examples validate \
375363
--spec-file spec/order-service.yaml
376364
```
@@ -379,8 +367,7 @@ docker run --rm \
379367

380368
```bash
381369
docker run --rm \
382-
-v "$PWD/spec:/usr/src/app/spec" \
383-
-v "$PWD/custom-examples:/usr/src/app/custom-examples" \
370+
-v "$(pwd):/usr/src/app" \
384371
specmatic/enterprise examples validate \
385372
--spec-file spec/order-service.yaml \
386373
--examples custom-examples

docs/supported_protocols/asyncapi/jms.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ Start your application that implements the AsyncAPI specification. The applicati
310310
Execute the contract tests using the Specmatic Docker image:
311311

312312
```bash
313-
docker run --network host -v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" -v "$PWD/spec:/usr/src/app/spec" specmatic/enterprise test
313+
docker run --network host -v "$(pwd):/usr/src/app" specmatic/enterprise test
314314
```
315315

316316
Specmatic-async will:

docs/supported_protocols/asyncapi/kafka.mdx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Please refer to [Specmatic documentation](/references/configuration) for more de
8383
Now we can run below command to spin a Kafka mock server. Please note the volume mapping to pass the specmatic.yaml to the Kafka Docker image and also the port mappings.
8484

8585
```shell
86-
docker run -p 9092:9092 -p 2181:2181 -p 29092:29092 -v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" specmatic/enterprise
86+
docker run --network host -v "$(pwd):/usr/src/app" specmatic/enterprise
8787
```
8888
This should produce logs that shows that Specmatic Kafka server has started and listening on topics.
8989

@@ -99,7 +99,7 @@ Starting api server on port:29092
9999

100100
The API server can be started on a port other than 29092 by passing the desired port via `--mock-server-api-port` CLI argument as follows.
101101
```shell
102-
docker run -p 9092:9092 -p 2181:2181 -p 3000:3000 -v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" specmatic/enterprise --mock-server-api-port=3000
102+
docker run --network host -v "$(pwd):/usr/src/app" specmatic/enterprise --mock-server-api-port=3000
103103
```
104104

105105
**Note:**
@@ -110,11 +110,7 @@ However, if you need to test against an **existing Kafka broker** (e.g., one run
110110
For example, to connect to a Kafka broker running on `localhost:9092`, use the following command:
111111

112112
```bash
113-
docker run -p 9999:9999 \
114-
-v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" \
115-
--network host \
116-
specmatic/enterprise \
117-
--external-broker-url localhost:9092
113+
docker run --network host -v "$(pwd):/usr/src/app" specmatic/enterprise --external-broker-url localhost:9092
118114
```
119115

120116
The `--network host` flag is important when using `localhost` for the broker address, as it allows the container to access the host network directly. This avoids common issues with Docker container networking when referring to services on the host machine.
@@ -378,10 +374,10 @@ Start the Specmatic Kafka mock server using the following command:
378374

379375
```bash
380376
docker run --rm --name specmatic-kafka-mock \
381-
-p 9999:9999 \
382-
-v "$PWD/spec.yaml:/usr/src/app/spec.yaml" \
377+
--network host \
378+
-v "$(pwd):/usr/src/app" \
383379
specmatic/enterprise \
384-
virtualize spec.yaml \
380+
mock spec.yaml \
385381
--external-broker-url host.docker.internal:9092
386382
```
387383

@@ -495,7 +491,7 @@ To test this service from the command line, follow the below steps.
495491
2. **Run the Service**: Start your service locally.
496492
3. **Run Contract Tests**: Use the following command to run the contract tests against the service by replacing `kafka_broker_host` and `kafka_broker_port` with appropriate values:
497493
```shell
498-
docker run --network="host" -v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" specmatic/enterprise test --host=<kafka_broker_host> --port=<kafka_broker_port>
494+
docker run --network="host" -v "$(pwd):/usr/src/app" specmatic/enterprise test --host=<kafka_broker_host> --port=<kafka_broker_port>
499495
```
500496

501497
To get information around all the CLI args of the `test` command, run the following command.
@@ -568,7 +564,7 @@ Start your application that implements the AsyncAPI specification. The applicati
568564
Execute the contract tests using the Specmatic Docker image:
569565

570566
```bash
571-
docker run --network host -v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" -v "$PWD/spec:/usr/src/app/spec" specmatic/enterprise test
567+
docker run --network host -v "$(pwd):/usr/src/app" specmatic/enterprise test
572568
```
573569

574570
Specmatic-async will:

docs/supported_protocols/asyncapi/migrate-from-specmatic-kafka-to-async.mdx

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Migrating to specmatic-async
2+
title: Migrating to Specmatic Enterprise
33
sidebar_position: 11
4-
sidebar_label: Migrating to specmatic-async
4+
sidebar_label: Migrating to Specmatic Enterprise
55
---
66

7-
# Migrating from `specmatic-kafka` to `specmatic-async`
7+
# Migrating from `specmatic-kafka` to `specmatic enterprise`
88

9-
Migrating to `specmatic-async` unlocks multi-protocol support, improved configuration, and a unified approach to async contract testing and mocking. This guide walks you through the key steps for a smooth transition.
9+
Migrating to `specmatic enterprise` unlocks multi-protocol support, improved configuration, and a unified approach to async contract testing and mocking. This guide walks you through the key steps for a smooth transition.
1010

1111
## Migration Steps
1212

@@ -46,7 +46,7 @@ contracts:
4646
Refer to the [Configuration Reference](./index.mdx#configuration-reference) for all available options.
4747
4848
### 2. Update Docker Image
49-
Replace the `specmatic-kafka` image with `specmatic-async` in your Docker commands.
49+
Replace the `specmatic/specmatic-kafka` image with `specmatic/enterprise` in your Docker commands.
5050

5151
**Before:**
5252
```bash
@@ -73,10 +73,9 @@ public class KafkaContractTest implements SpecmaticKafkaContractTest {
7373
```
7474
**After:**
7575
```java
76-
import com.specmatic.async.AsyncMock;
77-
import com.specmatic.async.SpecmaticAsyncContractTest;
76+
import io.specmatic.enterprise.SpecmaticContractTest
7877
79-
public class AsyncContractTest implements SpecmaticAsyncContractTest {
78+
public class AsyncContractTest implements SpecmaticContractTest {
8079
// ...
8180
}
8281
```
@@ -119,9 +118,9 @@ jobs:
119118
- name: Run Contract Tests
120119
run: |
121120
docker run --rm \
122-
-v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" \
123-
-v "$PWD/spec:/usr/src/app/spec" \
124-
-v "$PWD/specmatic-kafka-config.properties:/usr/src/app/specmatic-kafka-config.properties" \
121+
-v "$(pwd)/specmatic.yaml:/usr/src/app/specmatic.yaml" \
122+
-v "$(pwd)/spec:/usr/src/app/spec" \
123+
-v "$(pwd)/specmatic-kafka-config.properties:/usr/src/app/specmatic-kafka-config.properties" \
125124
specmatic/enterprise test
126125
```
127126

@@ -169,25 +168,25 @@ jobs:
169168
- name: Run Contract Tests
170169
run: |
171170
docker run --rm \
172-
-v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" \
173-
-v "$PWD/spec:/usr/src/app/spec" \
171+
-v "$(pwd)/specmatic.yaml:/usr/src/app/specmatic.yaml" \
172+
-v "$(pwd)/spec:/usr/src/app/spec" \
174173
specmatic/enterprise test
175174
```
176175

177176
### Docker Setup Migration
178177
**Before (specmatic-kafka):**
179178
```bash
180179
docker run --rm \
181-
-v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" \
182-
-v "$PWD/spec:/usr/src/app/spec" \
183-
-v "$PWD/specmatic-kafka-config.properties:/usr/src/app/specmatic-kafka-config.properties" \
180+
-v "$(pwd)/specmatic.yaml:/usr/src/app/specmatic.yaml" \
181+
-v "$(pwd)/spec:/usr/src/app/spec" \
182+
-v "$(pwd)/specmatic-kafka-config.properties:/usr/src/app/specmatic-kafka-config.properties" \
184183
specmatic/enterprise test
185184
```
186185
**After (specmatic-async):**
187186
```bash
188187
docker run --rm \
189-
-v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" \
190-
-v "$PWD/spec:/usr/src/app/spec" \
188+
-v "$(pwd)/specmatic.yaml:/usr/src/app/specmatic.yaml" \
189+
-v "$(pwd)/spec:/usr/src/app/spec" \
191190
specmatic/enterprise test
192191
```
193192

0 commit comments

Comments
 (0)