Skip to content

Commit 034d0ac

Browse files
committed
docs: Add Docker usage note to README for safer execution of LLM-generated shell scripts
1 parent 60742b4 commit 034d0ac

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Build stage
2+
FROM golang:1.24.1-alpine AS builder
3+
4+
# Install build dependencies
5+
RUN apk add --no-cache git make
6+
7+
# Set working directory
8+
WORKDIR /app
9+
10+
# Copy go mod and sum files
11+
COPY go.mod go.sum ./
12+
13+
# Download dependencies
14+
RUN go mod download
15+
16+
# Copy source code
17+
COPY . .
18+
19+
# Build the application
20+
RUN make build
21+
22+
# Final stage
23+
FROM alpine:latest
24+
25+
# Install runtime dependencies
26+
RUN apk add --no-cache ca-certificates curl bash
27+
28+
# Set working directory
29+
WORKDIR /app
30+
31+
# Copy binary from builder and install it in PATH
32+
COPY --from=builder /app/bin/llmscript /usr/local/bin/
33+
34+
# Copy examples directory
35+
COPY --from=builder /app/examples ./examples
36+
37+
# Set the default command
38+
CMD ["llmscript"]

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ go install github.com/statico/llmscript@latest
5252

5353
By default, llmscript will use Ollama with the `llama3.2` model. You can configure this by creating a config file with the `llmscript --write-config` command to create a config file in `~/.config/llmscript/config.yaml` which you can edit. You can also use command-line args (see below).
5454

55+
> [!NOTE]
56+
> Spooked by running LLM-generated shell scripts? Good for you! Consider running this via Docker:
57+
>
58+
> `docker run --network host -it -v "$(pwd):/data" -w /data ghcr.io/statico/llmscript examples/hello-world`
59+
5560
## How it works
5661

5762
Given a script description written in natural language, llmscript works by:

0 commit comments

Comments
 (0)