Skip to content

Commit 8c93507

Browse files
committed
Sync open source content 🐝 (from 22b8b1f2d39ea262b2bf4053ecfcc70056bbe03c)
1 parent f77c974 commit 8c93507

File tree

1 file changed

+11
-54
lines changed

1 file changed

+11
-54
lines changed

docs/speakeasy-reference/cli/docker.mdx

Lines changed: 11 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
description: "Use Speakeasy Docker images to generate SDKs and manage your API tooling in containerized environments. Includes all necessary build tools for supported languages."
2+
description: "Use Speakeasy Docker images to run CLI commands for validating OpenAPI specs, checking SDK status, and other non-generation tasks in containerized environments."
33
slug: /speakeasy-cli/docker/
44
---
55

66
# Using Speakeasy with Docker
77

8-
The Speakeasy Docker image provides a containerized environment for running Speakeasy CLI commands. The image includes all necessary build tools for all languages supported by Speakeasy, making it ideal for CI/CD pipelines and consistent development environments.
8+
The Speakeasy Docker image provides a containerized environment for running Speakeasy CLI commands. The image does not include language toolchains, so it cannot be used for SDK generation. Use it for other tasks like validating OpenAPI specs, checking SDK status, and running quickstart commands.
99

1010
## Docker image
1111

@@ -56,23 +56,6 @@ docker run -it -v "$(pwd):/workspace" -w "/workspace" \
5656

5757
Create an API key in the [Speakeasy Platform](https://app.speakeasy.com) and set it as the `SPEAKEASY_API_KEY` environment variable.
5858

59-
## Generate SDK
60-
61-
To generate an SDK using the Docker image, mount your workspace directory and run the generation command:
62-
63-
```bash
64-
docker run -it -v "$(pwd):/workspace" -w "/workspace" \
65-
ghcr.io/speakeasy-api/speakeasy:latest run all --pinned --frozen-workflow-lockfile --output console
66-
```
67-
68-
This command:
69-
- Mounts the current directory to `/workspace` in the container
70-
- Sets the working directory to `/workspace`
71-
- Runs all configured SDK generation workflows
72-
- Uses pinned versions for reproducibility
73-
- Uses a frozen workflow lockfile to ensure consistent dependencies
74-
- Outputs results to the console
75-
7659
## Common usage examples
7760

7861
### Run quickstart
@@ -93,15 +76,6 @@ docker run -it -v "$(pwd):/workspace" -w "/workspace" \
9376
ghcr.io/speakeasy-api/speakeasy:latest validate openapi -s ./openapi.yaml
9477
```
9578

96-
### Generate SDK for specific language
97-
98-
Generate an SDK for a specific language:
99-
100-
```bash
101-
docker run -it -v "$(pwd):/workspace" -w "/workspace" \
102-
ghcr.io/speakeasy-api/speakeasy:latest run -t typescript
103-
```
104-
10579
### Check SDK status
10680

10781
Check the status of your SDK generation:
@@ -111,42 +85,26 @@ docker run -it -v "$(pwd):/workspace" -w "/workspace" \
11185
ghcr.io/speakeasy-api/speakeasy:latest status
11286
```
11387

114-
## Included build tools
115-
116-
The Speakeasy Docker image includes all necessary build tools for generating SDKs in the following languages:
117-
118-
- TypeScript/JavaScript (Node.js, npm, pnpm, yarn)
119-
- Python (Python 3.x, pip, poetry)
120-
- Go (Go compiler and tools)
121-
- Java (JDK, Maven, Gradle)
122-
- C# (.NET SDK)
123-
- PHP (PHP runtime and Composer)
124-
- Ruby (Ruby runtime and Bundler)
125-
- Rust (Rust compiler and Cargo)
126-
127-
This ensures that SDK generation works out of the box without requiring additional setup or dependencies.
128-
12988
## Using in CI/CD pipelines
13089

131-
The Docker image is designed for use in CI/CD pipelines. Here's an example GitHub Actions workflow:
90+
The Docker image is designed for use in CI/CD pipelines. Here's an example GitHub Actions workflow for validating an OpenAPI spec:
13291

13392
```yaml
134-
name: Generate SDK
93+
name: Validate OpenAPI
13594
on:
13695
push:
13796
branches: [main]
13897

13998
jobs:
140-
generate:
99+
validate:
141100
runs-on: ubuntu-latest
142101
steps:
143102
- uses: actions/checkout@v4
144103

145-
- name: Generate SDK
104+
- name: Validate OpenAPI spec
146105
run: |
147106
docker run -v "$(pwd):/workspace" -w "/workspace" \
148-
-e SPEAKEASY_API_KEY=${{ secrets.SPEAKEASY_API_KEY }} \
149-
ghcr.io/speakeasy-api/speakeasy:latest run all --pinned --frozen-workflow-lockfile
107+
ghcr.io/speakeasy-api/speakeasy:latest validate openapi -s ./openapi.yaml
150108
```
151109
152110
## Volume mounts and permissions
@@ -170,17 +128,16 @@ If authentication fails, ensure that:
170128

171129
### File permission errors
172130

173-
If you encounter file permission errors, try running the container with your user ID:
131+
If file permission errors occur, try running the container with the appropriate user ID:
174132

175133
```bash
176134
docker run -it --user $(id -u):$(id -g) \
177135
-v "$(pwd):/workspace" -w "/workspace" \
178-
ghcr.io/speakeasy-api/speakeasy:latest run
136+
ghcr.io/speakeasy-api/speakeasy:latest validate openapi -s ./openapi.yaml
179137
```
180138

181139
### Network connectivity
182140

183-
Ensure your Docker container has network access to:
141+
Ensure the Docker container has network access to:
184142
- The Speakeasy Platform (app.speakeasy.com)
185-
- Package registries for your target languages
186-
- Your OpenAPI specification source (if remote)
143+
- The OpenAPI specification source (if remote)

0 commit comments

Comments
 (0)