Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ config.yaml
*.local.yaml
*.local.yml
*.local.json
*.log
*.log
/test/reports/
3 changes: 3 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ make build # Build optimised binary with version info
make build-local # Build binary to ./build/ (fast, for testing)
make run # Run with version info
make run-debug # Run with debug logging
make docker-build # Build Docker image with goreleaser (requires goreleaser)
make docker-build-local # Build Docker image locally (no goreleaser required)
make docker-run # Run Docker image with local config
make ci # Run full CI pipeline locally
make help # Show all available targets
```
Expand Down
41 changes: 41 additions & 0 deletions docs/content/development/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ make dev
| `make lint` | Run golangci-lint |
| `make ready` | Run all checks (test-short, test-race, fmt, lint, align) |

### Docker Commands

| Command | Description |
|---------|-------------|
| `make docker-build-local` | Build Docker image locally (no goreleaser required) |
| `make docker-build` | Build Docker image with goreleaser (requires goreleaser installed) |
| `make docker-run` | Run Docker image with local config |

## Configuration

### Development Config
Expand Down Expand Up @@ -183,6 +191,39 @@ Run with hot reload:
air
```

## Docker Development

### Building Docker Images Locally

You can build Docker images without requiring [goreleaser](https://goreleaser.com/):

```bash
# Quick local build (recommended for development)
make docker-build-local

# This produces: ghcr.io/thushan/olla:local
```

If you have goreleaser installed, use the full release build:

```bash
# Full goreleaser build with all platforms and tags
make docker-build
```

### Running the Docker Image

```bash
# Run the locally built image
docker run -p 40114:40114 \
-v "$(pwd)/config/config.local.yaml:/config/config.yaml:ro" \
-e OLLA_CONFIG_FILE=/config/config.yaml \
ghcr.io/thushan/olla:local
Comment thread
coderabbitai[bot] marked this conversation as resolved.

# Or use the convenience make target
make docker-run
Comment thread
coderabbitai[bot] marked this conversation as resolved.
```

## IDE Configuration

### VS Code
Expand Down
16 changes: 16 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,24 @@ build-snapshot:
# Deprecated: use build-local or build-snapshot instead
ready-local: build-snapshot

# Build Docker image without goreleaser (for local development)
docker-build-local:
@echo "Building Docker image locally (without goreleaser)..."
@echo "Building olla binary to root..."
@go build $(LDFLAGS) -o olla .
@echo "Building Docker image..."
@docker build -t ghcr.io/thushan/olla:local .
@echo "Cleaning up binary..."
@rm -f olla
Comment thread
coderabbitai[bot] marked this conversation as resolved.
@echo "Docker image built: ghcr.io/thushan/olla:local"
@docker images --filter reference='*olla*local*'

# Build and test Docker image locally
docker-build:
@if ! command -v goreleaser &> /dev/null; then \
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
echo "❌ goreleaser not found. Use 'make docker-build-local' instead (no goreleaser required)"; \
exit 1; \
fi
@echo "Building Docker image locally..."
@goreleaser release --snapshot --clean --skip=publish,announce,sign,sbom
@echo "Docker images:"
Expand Down
6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ git clone https://github.com/thushan/olla.git && cd olla && make build-release
./bin/olla
```

```bash
# Build Docker image locally (no goreleaser required)
git clone https://github.com/thushan/olla.git && cd olla && make docker-build-local
docker run -p 40114:40114 ghcr.io/thushan/olla:local
```

### Verification

When you have everything running, you can check it's all working with:
Expand Down
Loading