Skip to content

Commit 2a3949f

Browse files
committed
core(go install method)
1 parent cf20c3e commit 2a3949f

7 files changed

Lines changed: 44 additions & 27 deletions

File tree

.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ before:
77

88
builds:
99
- id: d4s
10-
main: ./cmd/d4s
10+
main: .
1111
binary: d4s
1212
env:
1313
- CGO_ENABLED=0

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM golang:alpine AS builder
22

33
WORKDIR /app
44
COPY . .
5-
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o d4s ./cmd/d4s/main.go
5+
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o d4s .
66

77
FROM scratch
88
COPY --from=builder /app/d4s /d4s

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Build the application
44
build:
5-
go build -o d4s cmd/d4s/main.go
5+
go build -o d4s .
66

77
# Run the application
88
run: build
@@ -31,11 +31,11 @@ lint:
3131

3232
# Build for multiple platforms
3333
build-all:
34-
GOOS=linux GOARCH=amd64 go build -o dist/d4s-linux-amd64 cmd/d4s/main.go
35-
GOOS=linux GOARCH=386 go build -o dist/d4s-linux-x86 cmd/d4s/main.go
36-
GOOS=linux GOARCH=arm GOARM=6 go build -o dist/d4s-linux-armv6 cmd/d4s/main.go
37-
GOOS=linux GOARCH=arm GOARM=7 go build -o dist/d4s-linux-armv7 cmd/d4s/main.go
38-
GOOS=darwin GOARCH=amd64 go build -o dist/d4s-darwin-amd64 cmd/d4s/main.go
39-
GOOS=darwin GOARCH=arm64 go build -o dist/d4s-darwin-arm64 cmd/d4s/main.go
40-
GOOS=windows GOARCH=amd64 go build -o dist/d4s-windows-amd64.exe cmd/d4s/main.go
34+
GOOS=linux GOARCH=amd64 go build -o dist/d4s-linux-amd64 .
35+
GOOS=linux GOARCH=386 go build -o dist/d4s-linux-x86 .
36+
GOOS=linux GOARCH=arm GOARM=6 go build -o dist/d4s-linux-armv6 .
37+
GOOS=linux GOARCH=arm GOARM=7 go build -o dist/d4s-linux-armv7 .
38+
GOOS=darwin GOARCH=amd64 go build -o dist/d4s-darwin-amd64 .
39+
GOOS=darwin GOARCH=arm64 go build -o dist/d4s-darwin-arm64 .
40+
GOOS=windows GOARCH=amd64 go build -o dist/d4s-windows-amd64.exe .
4141

README.md

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# D-Force (d4s)
77

8-
D4S (pronounced *D-Force*) brings the power and ergonomics of K9s to the local Docker ecosystem. Stop wrestling with verbose CLI commands and start managing your containers like a pro.
8+
D4S (pronounced *D-Force*) brings the power and ergonomics of [K9s](https://github.com/derailed/k9s) to the local Docker ecosystem. Stop wrestling with verbose CLI commands and start managing your containers like a pro.
99

1010
<a target="_blank" href="https://github.com/jr-k/d4s/commit/HEAD"><img src="https://img.shields.io/github/last-commit/jr-k/d4s?color=green" /></a>
1111
<a target="_blank" href="https://github.com/jr-k/d4s/stargazers"><img src="https://img.shields.io/github/stars/jr-k/d4s?style=flat&color=yellow" /></a>
@@ -34,12 +34,12 @@ D4S (pronounced *D-Force*) brings the power and ergonomics of K9s to the local D
3434
- **Keyboard Centric**: Vim-like navigation (`j`/`k`), shortcuts for everything. No mouse needed.
3535
- **Full Scope**: Supports **Containers**, **Images**, **Volumes**, **Networks**.
3636
- **Compose Aware**: Easily identify containers belonging to **Compose Projects**.
37-
- **Swarm Aware**: Supports **Nodes**, **Stacks**, **Services**, **Tasks**, **Secrets**, **Configs**.
37+
- **Swarm Aware**: Supports **Nodes**, **Stacks**, **Services**, **Tasks**, **Secrets**, **ConfigMaps**.
3838
- **Docker Settings**: Supports **Contexts**, **Plugins**.
3939
- **Remote via SSH Tunnel**: Manage remote Docker daemons over SSH with port-forwarding to localhost.
4040
- **Powerful Search**: Instant fuzzy filtering (`/`) and command palette (`:`).
4141
- **Live Stats**: Real-time CPU/Mem usage for containers and host context.
42-
- **Advanced Logs**: Streaming logs with auto-scroll, timestamps toggle, wrap mode and dump to file.
42+
- **Advanced Logs**: Streaming logs with auto-scroll, fullscreen, timestamps toggle, wrap mode, marks and save to file (`ctrl-s`).
4343
- **Quick Shell**: Drop into a container shell (`s`) in a split second.
4444
- **Contextual Actions**: Inspect, Restart, Stop, Prune, Delete with safety confirmations.
4545

@@ -76,14 +76,32 @@ echo "alias d4s='docker run --rm --pull always -it -v /var/run/docker.sock:/var/
7676
*After running this, either restart your terminal or run `source ~/.zshrc` (or `source ~/.bashrc` for Bash) to enable the alias.*
7777
</details>
7878

79+
<details>
80+
<summary><b>Go Install</b></summary>
81+
82+
>Requirement: Go 1.25+
83+
84+
```bash
85+
go install github.com/jr-k/d4s@latest
86+
```
87+
88+
The binary lands in `$(go env GOBIN)` (or `$(go env GOPATH)/bin`). Make sure that directory is on your `PATH`.
89+
90+
To upgrade later, just re-run the same command, or use [`gup`](https://github.com/nao1215/gup) to bulk-update all your `go install`-managed binaries:
91+
92+
```bash
93+
gup update
94+
```
95+
</details>
96+
7997
<details>
8098
<summary><b>From Source</b></summary>
8199

82-
>Requirement: Go 1.21+
100+
>Requirement: Go 1.25+
83101
```bash
84102
git clone https://github.com/jr-k/d4s.git
85103
cd d4s
86-
go build -o d4s cmd/d4s/main.go
104+
go build -o d4s .
87105
sudo mv d4s ~/.local/bin/
88106
```
89107

@@ -93,7 +111,7 @@ mv d4s ~/.local/bin/
93111
d4s
94112

95113
# Quickly run from source
96-
go run cmd/d4s/main.go
114+
go run .
97115
```
98116
</details>
99117

@@ -147,6 +165,7 @@ sudo zypper install d4s
147165
```
148166
</details>
149167

168+
150169
> ### Windows
151170
152171
<details>
@@ -180,7 +199,7 @@ When deciding which Docker context to use, D4S applies the following precedence:
180199
4. `d4s.defaultContext` from `config.yaml`
181200
5. Docker CLI's own current/default context behavior
182201

183-
If you select the literal `default` context from `shift-t`, D4S uses Docker's normal default context resolution rather than a named custom context.
202+
If you select the literal `default` context from `shift-o`, D4S uses Docker's normal default context resolution rather than a named custom context.
184203

185204
All settings are optional and have sensible defaults. Below is a fully documented example:
186205

@@ -194,7 +213,7 @@ d4s:
194213
readOnly: false
195214
# Default Docker context for d4s when --context, DOCKER_HOST, and DOCKER_CONTEXT are not set. Default: ""
196215
defaultContext: ""
197-
# Default view on startup (containers, images, volumes, networks, services, nodes, compose, secrets). Default: "" (containers)
216+
# Default view on startup (containers, images, volumes, networks, services, nodes, compose, aliases, secrets, configs, stacks, tasks, contexts, plugins). Default: "" (containers)
198217
defaultView: ""
199218
# When true, Ctrl+C won't exit — use :quit instead. Default: false
200219
noExitOnCtrlC: false
@@ -213,7 +232,7 @@ d4s:
213232
crumbsless: false
214233
# Invert all theme colors (dark↔light), preserving hue. Default: false
215234
invert: false
216-
# Skin nameloads from $XDG_DATA_HOME/d4s/skins/<name>.yaml. Default: "default" (builtin: default, dracula)
235+
# Skin name, loads from $XDG_DATA_HOME/d4s/skins/<name>.yaml. Default: "default" (builtin: default, dracula, monokai, nord, gruvbox, tokyonight)
217236
skin: "default"
218237

219238
# Log viewer settings
@@ -284,11 +303,11 @@ Port-forwards expose a remote container port on your local machine (`localhost:<
284303

285304
## Command Palette
286305

287-
Use `shift-t` to open the Docker context picker, switch the current d4s session to a different context, and save that selection as the default context for future d4s launches.
306+
Use `shift-o` to open the Docker context picker, switch the current d4s session to a different context, and save that selection as the default context for future d4s launches.
288307

289308
If `DOCKER_HOST` or `DOCKER_CONTEXT` is set in your shell, those environment variables still override the saved D4S default for that launch.
290309

291-
In a container log view opened with `shift-d` to export the full log of that container to `~/.config/d4s/logs/<container-id>.<timestamp>.log` (or the equivalent `$XDG_CONFIG_HOME/d4s/logs/...` path).
310+
In a container log view, press `ctrl-s` to save the full log of that container to `~/.config/d4s/logs/<container>.<timestamp>.log` (or the equivalent `$XDG_CONFIG_HOME/d4s/logs/...` path).
292311

293312
## Contributing
294313

@@ -300,6 +319,6 @@ There's still plenty to do! Take a look at the [contributing guide](CONTRIBUTING
300319
[<img src="./docs/img/social/github.png" width="64">](https://github.com/jr-k/d4s/issues/new/choose)
301320

302321
---
303-
*Built with Go & Tview. Inspired by K9s.*
322+
*Built with Go & [Tview](https://github.com/rivo/tview). Inspired by [K9s](https://github.com/derailed/k9s).*
304323

305324
*D4s uses several open source libraries. Thanks to the maintainers who make this possible.*

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,4 @@ require (
5656
golang.org/x/term v0.44.0 // indirect
5757
golang.org/x/text v0.38.0 // indirect
5858
golang.org/x/time v0.14.0 // indirect
59-
)
60-
61-
replace github.com/rivo/tview => github.com/jr-k/tview v0.0.0-20260117030207-e6ad55b7e52d
59+
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ github.com/guptarohit/asciigraph v0.7.3 h1:p05XDDn7cBTWiBqWb30mrwxd6oU0claAjqeyt
6464
github.com/guptarohit/asciigraph v0.7.3/go.mod h1:dYl5wwK4gNsnFf9Zp+l06rFiDZ5YtXM6x7SRWZ3KGag=
6565
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
6666
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
67-
github.com/jr-k/tview v0.0.0-20260117030207-e6ad55b7e52d h1:CvPmOP/+4AI7FKVS4movN8PwoAh6ZIU6znNwmADvxfI=
68-
github.com/jr-k/tview v0.0.0-20260117030207-e6ad55b7e52d/go.mod h1:cSfIYfhpSGCjp3r/ECJb+GKS7cGJnqV8vfjQPwoXyfY=
6967
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
7068
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
7169
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -94,6 +92,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
9492
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
9593
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
9694
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
95+
github.com/rivo/tview v0.42.0 h1:b/ftp+RxtDsHSaynXTbJb+/n/BxDEi+W3UfF5jILK6c=
96+
github.com/rivo/tview v0.42.0/go.mod h1:cSfIYfhpSGCjp3r/ECJb+GKS7cGJnqV8vfjQPwoXyfY=
9797
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
9898
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
9999
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
File renamed without changes.

0 commit comments

Comments
 (0)