Skip to content

Commit

Permalink
Merge pull request #89 from ymtdzzz/chore/docker_support
Browse files Browse the repository at this point in the history
Add Docker image deployment
  • Loading branch information
ymtdzzz authored Jun 30, 2024
2 parents 9679a2e + d437dfb commit d5034cc
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
with:
go-version-file: go.mod
cache: true
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: goreleaser/goreleaser-action@v6
with:
version: '~> v1'
Expand Down
29 changes: 29 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,32 @@ brews:
owner: ymtdzzz
name: homebrew-tap
token: "{{ .Env.TAP_GITHUB_TOKEN }}"

dockers:
- image_templates:
- 'ymtdzzz/otel-tui:{{ .Tag }}-amd64'
- 'ymtdzzz/otel-tui:latest-amd64'
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
dockerfile: Dockerfile.goreleaser
- image_templates:
- 'ymtdzzz/otel-tui:{{ .Tag }}-arm64'
- 'ymtdzzz/otel-tui:latest-arm64'
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
goarch: arm64
dockerfile: Dockerfile.goreleaser

docker_manifests:
- name_template: 'ymtdzzz/otel-tui:{{ .Tag }}'
image_templates:
- 'ymtdzzz/otel-tui:{{ .Tag }}-amd64'
- 'ymtdzzz/otel-tui:{{ .Tag }}-arm64'
- name_template: 'ymtdzzz/otel-tui:latest'
image_templates:
- 'ymtdzzz/otel-tui:latest-amd64'
- 'ymtdzzz/otel-tui:latest-arm64'
7 changes: 7 additions & 0 deletions Dockerfile.goreleaser
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM gcr.io/distroless/static-debian12:latest

COPY otel-tui /

USER nonroot

CMD [ "/otel-tui" ]
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,69 @@ Logs
![Logs](./docs/logs.png)

## Getting Started
Currently, this tool exposes port 4317 to receive OpenTelemetry signals.

### Homebrew

```sh
$ brew install ymtdzzz/tap/otel-tui
```

### Docker

Run in the container simply:

```sh
$ docker run --rm -it --name otel-tui ymtdzzz/otel-tui:latest
```

Or, run as a background process and attach it:

```sh
# Run otel-tui as a background process
$ docker run --rm -dit --name otel-tui ymtdzzz/otel-tui:latest

# Show TUI in your current terminal session
$ docker attach otel-tui
```

### Docker Compose

First, add service to your manifest (`docker-compose.yaml`) for the instrumanted app

```yml
oteltui:
image: ymtdzzz/otel-tui:latest
container_name: otel-tui
stdin_open: true
tty: true
```
Modify configuration for otelcol
```yml
exporters:
otlp:
endpoint: oteltui:4317
service:
pipelines:
traces:
exporters: [otlp]
logs:
exporters: [otlp]
```
Run as a background process and attach it:
```sh
# Run services as usual
$ docker compose up -d

# Show TUI in your current terminal session
$ docker compose attach oteltui
```


### Executable Binary from Github Release page

https://github.com/ymtdzzz/otel-tui/releases
Expand Down

0 comments on commit d5034cc

Please sign in to comment.