DEV Community

Cover image for Dockyard is a Faster Lazydocker, Written in Rust (Because Of Course It Is)
Timur Gabaidulin
Timur Gabaidulin

Posted on

Dockyard is a Faster Lazydocker, Written in Rust (Because Of Course It Is)

Repo

I was perfectly happy using Lazy Docker. It works. It’s stable. It does exactly what a Docker TUI should do.

Then, after an irresponsible amount of caffeine, I had a thought no one needed me to have:

“This would be better if it were written in Rust.”

There was no problem to solve. No unmet need. No user request. I did it anyway.

This is Dockyard.

Dockyard TUI

A problem nobody had

Lazy Docker is a good tool. But if you stare at it long enough, you can convince yourself there are issues:

It’s written in Go

A cold start takes about 247 ms

It can use around 40 MB of memory

The binary is 13 MB

None of this is bad. None of this matters.

I chose to care anyway.

Dockyard

After three weeks of arguing with the borrow checker, I ended up with Dockyard: a Docker container manager that does roughly 80 percent of what Lazy Docker does, except it’s written in Rust and starts noticeably faster.

Startup time

Lazy Docker starts in roughly:

~247 ms cold

~89 ms warm

Dockyard starts in roughly:

~31 ms cold

~12 ms warm

Dockyard launches fast enough that you briefly wonder if it actually did anything.

Real-world impact: if you open your Docker TUI ten times a day for a year, you save about 43 seconds.

That is not enough time to change your life. It is enough time to feel correct.

Memory usage

Lazy Docker typically sits around:

~38–41 MB of memory

Dockyard sits around:

~6–8 MB of memory

That’s roughly an 82 percent reduction.

This is not meaningful on a modern machine. Your Electron-based Slack instance uses more memory to display a single emoji reaction.

I will still mention it every chance I get.

Binary size

Lazy Docker: ~13 MB

Dockyard: ~2.7 MB (stripped)

Your disk is enormous. This does not matter.

I spent three days making it matter.

Development metrics that definitely matter

Time to first successful build:

Lazy Docker: minutes

Dockyard: three weeks

Lines written to appease lifetime annotations:

Lazy Docker: zero

Dockyard: 847

Ability to casually mention Rust in unrelated conversations:

Lazy Docker: none

Dockyard: excessive

Quality of life decisions:

Lazy Docker: reasonable

Dockyard: questionable

What Dockyard actually does

Lists containers, images, and volumes

Starts, stops, and removes containers

Allows you to pull and remove images

Talks directly to the Docker API using bollard

Starts fast, stays small, exits cleanly

It is memory-safe without a garbage collector.
It is thread-safe even when nothing is threaded.
It is fearless about concurrency it does not yet have.

What it does not do (yet)

Metrics graphs

Advanced debugging tools

Users besides me

Lazy Docker is still the better tool for most people. Dockyard is faster, smaller, and less complete. Those trade-offs were intentional.

The Dockyard install process doubles as a reminder that you chose this path.

Why I actually built it

I originally wrote a Docker TUI in Python for personal use. Then I ran it on a small VPS and decided that learning Rust would be easier than optimizing Python.

This was incorrect, but educational.

I learned async Rust, the Docker API surface, terminal UI layout, and that Docker exposes an alarming number of timestamp formats. I also learned that shaving milliseconds off startup time is an extremely effective source of dopamine.

Dockyard exists because I wanted to understand the problem end to end, not because the ecosystem needed another tool.

Conclusion

Is Dockyard better than Lazy Docker?
No.

Is it faster?
Yes, in ways you will not notice.

Should you use it?
If you like small, fast binaries and Rust code written by someone who cared too much, maybe.

Was it a good use of three weeks?
Objectively, no.

Would I do it again?
Probably.

Top comments (0)