Skip to content

Commit b271dcb

Browse files
Copilothawkeyexl
andauthored
Add Docker installation instructions to get started guide (#112)
* Initial plan * Add Docker installation instructions to get started guide Co-authored-by: hawkeyexl <[email protected]> * Add cross-platform Docker commands for Windows, macOS, and Linux Co-authored-by: hawkeyexl <[email protected]> * Add inline test statements for Docker installation procedure Co-authored-by: hawkeyexl <[email protected]> * Simplify Docker installation: remove docker pull, use single command with . for current directory Co-authored-by: hawkeyexl <[email protected]> * Change Docker mount path to /app and add NPX vs Docker selection guidance Co-authored-by: hawkeyexl <[email protected]> * Update index.mdx * Update index.mdx --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: hawkeyexl <[email protected]> Co-authored-by: Manny Silva <[email protected]>
1 parent 3b8d3be commit b271dcb

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

docs/get-started/installation/index.mdx

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@ sidebar_label: Installation
44

55
import spec from "./sample.spec.json";
66
import CodeBlock from '@theme/CodeBlock';
7+
import Tabs from '@theme/Tabs';
8+
import TabItem from '@theme/TabItem';
79

810
# Installation
911

10-
Downloading and running Doc Detective is straightforward. Follow these steps to install Doc Detective and run your first test:
12+
Downloading and running Doc Detective is straightforward. You can install Doc Detective using NPX (Node.js) or Docker. Follow the instructions for your preferred method:
13+
14+
Choose *NPX* if you have Node.js installed and want to install Doc Detective on your machine locally. Choose *Docker* if you can't install applications locally, prefer containerized environments, need to avoid Node.js installation, or want to isolate Doc Detective from your system.
15+
16+
<Tabs>
17+
<TabItem value="npx" label="NPX" default>
1118

1219
1. Install prerequisites:
1320

@@ -41,6 +48,37 @@ Downloading and running Doc Detective is straightforward. Follow these steps to
4148
command: "npx doc-detective --input sample.spec.json"
4249
workingDirectory: "." */}
4350

51+
</TabItem>
52+
<TabItem value="docker" label="Docker">
53+
54+
1. Install prerequisites:
55+
56+
- [Docker](https://docs.docker.com/get-docker/)
57+
{/* step checkLink: "https://docs.docker.com/get-docker/" */}
58+
59+
2. Save this file to your current directory as _sample.spec.json_:
60+
61+
<CodeBlock language="json" title="sample.spec.json">
62+
{JSON.stringify(spec, null, 2)}
63+
</CodeBlock>
64+
65+
3. Run a test, pointing to the file you just created:
66+
67+
<CodeBlock language="bash" title="Run test">
68+
docker run -v .:/app docdetective/docdetective --input /app/sample.spec.json
69+
</CodeBlock>
70+
{/* step runShell:
71+
command: "docker run -v .:/app docdetective/docdetective --input /app/sample.spec.json"
72+
workingDirectory: "." */}
73+
74+
:::note
75+
76+
The `-v` argument mounts your current directory (`.`) to `/app` in the container, giving Doc Detective access to your test specification and enabling it to output results and screenshots. If your test specification is hosted at an HTTPS URL, the `-v` argument is not necessary.
77+
78+
:::
79+
80+
</TabItem>
81+
</Tabs>
4482

4583
Congratulations! You've run your first test with Doc Detective. :tada:
4684

0 commit comments

Comments
 (0)