-
1. Your Dev Environment Sucks
Why are our dev environments always broken? Why is everyone's first day at a job spent in misery, following some out-of-date wiki?
-
2. A Dev Environment Defined
Your dev environment is where you get work done, yes, but it's a coordinated set of tools. We'll learn exactly what they are and how the interact so they can be managed carefully.
-
Most of use a dev environment running on our computer, set up based on documentation. This is the worst of all worlds. Automation eliminates the need for most documentation and virtualization allows that automation to be easy to understand, easy to keep updated, and reliable to use.
Read this chapter now
-
4. What is Docker and How Does It Work?
Most people's problems with Docker stem from its difficult and inconsistent terminology, coupled with its vague documentation. This chapter will sort all that out for you.
-
5. Managing the Operating System With Base Images
All work is done in an operating system, but choosing the right one, and understanding that choice, is surprisingly difficult. It won't be after this chapter. You'll get a straightforward way to know what OS you are using and how to find a safe version of it to base your work on.
-
6. Installing Software in the Dev Environment
I used to follow instructions from Stack Overflow or random blog posts. Installing software in Docker doesn't have to be so fraught. This chapter details a step-by-step way to find the software vendor's installation instructions, use them, and make sure you keep using them.
-
7. Publishing Ports and Mounting Volumes to Do Development
Docker ports and volumes can be daunting, but for development, we don't need them to do much. This chapter clears away everything we don't care about and will explain how Docker interacts with your computer, so you can get work done.
-
8. Running Databases and Caches with One Line of Code
Docker's most powerful feature is DockerHub: a repository of ready-to-run images for any imaginable piece of software. This makes is far easier to use for running Postgres, Redis, Elasticsearch, or whatever. But the user experience isn't quite there. This chapter will give you the power to understand what you are running and how.
-
9. What is a Good User Experience for Automation Scripts?
Despite its power, Docker's command-line usability isn't great. We'll make it great using Bash scripts. Bash is the only reliable scripting language on any OS and computer, so it's a great choice to turn docker compose -f docker-compose.dx.yml --env-file=dx/env up
into dx/start
.
-
10. The Arcane World of the UNIX Command Line
The UNIX command line can be impenetrable. What are all those symbols doing? What's an output stream? Exit Codes?!?!? This chapter takes you from knowing nothing about the command line to having the vocabulary to understand documentation, examples, and even Internet blog posts.
-
11. Writing One Nice Script
This is a step-by-step walkthrough for making one nice script to automate a complicated command. The script will be bulletproof, user-friendly, and run anywhere reliably. And you'll learn a bit of Bash along the way!
-
12. Build the Remaining Scripts
Here, we'll build several other scripts that rely on the same code as our first one. We'll learn what you can and can't share between Bash scripts, and how to keep everything as organized and clean as possible.
-
13. Customizing Your Dev Environment
Running code inside Docker can sometimes feel like being outside in the winter with no dotfiles coat. You'll learn how to leverage the scripts you've built into a protocol. This protocol allows per-developer customization without a ton of special-casing, and almost no additional documentation to maintain.
-
14. Sustainably Maintaining The Dev Environment
It's one thing to build a dev environment, but another to maintain it. Here, you'll learn a repeatable series of steps to debug any Docker problem. We'll also go a bit deep on how all the images you've downloaded and built are managed…and how to keep your disk space under control.
-
15. There’s No Such Thing as a Free Lunch
Everything is a trade-off. This chapter will outline the downsides of the approach we have taken, including a few hard-to-understand gotchas.
-
16. Tech Companies Should Not Own Your Dev Environment
As a developer, you absolutely must control and understand your development environment. It's the most core competency you have. You can't cede that to a massive tech company or an underfunded startup. Docker and Bash give you that control.
-
A. The Docker Lexicon for Regular People
You can print this chapter out if, like me, you keep forgetting what the heck the “host” is.
-
B. Bash and Command-Line Quick Reference
Bash and Unix terms and symbols are notoriously hard to search for, and take a lot of repetition to internalize. This appendix provides a quick reference until you've put in your 10,000 hours :)
-
C. Protocols for Dev Environments
The scripts we built create a protocol that allows management of your dev environment. There is a
Foundational Core, which is what this book is mostly about, and then a Workspace, where your specific app's needs should be automated, too.
-
D. Colophon or, The Chapter About Fonts
Maybe you don't care about Docker, but have a burning desire to understand what fonts are used in the cover, or what programs I use to make diagrams. Find out here!