Let’s get cooking#

So, lets keep things simple. Assumptions are that you know how to use command line. So if that is not the case then you are going to struggle, but you knew that already right?

Get Docker#

Get Docker. Docker DevTools runs every tool inside a container, so if you don’t have Docker installed and running, none of this will work. Docker has excellent documentation, so I am not going to repeat it here.

You’ll also need Bash 4+ or zsh to use the shell aliases (macOS ships Bash 3 — upgrade with brew install bash or use zsh), or PowerShell 5.1+ / 7+ if you’d rather use the PowerShell version.

Cloning makes it easy to pull future updates with a simple git pull. This requires git — but if you don’t have git you probably don’t have Docker either.

git clone https://github.com/willhallonline/docker-devtools-aliases.git ~/.docker-devtools

Add to your shell#

Bash / zsh#

Add the following line to your .bashrc or .zshrc:

source ~/.docker-devtools/docker-devtools.sh

Then reload your shell:

source ~/.bashrc   # or: source ~/.zshrc

PowerShell#

Add the following line to your PowerShell profile ($PROFILE):

. "$HOME/.docker-devtools/docker-devtools.ps1"

Then reload your profile, or open a new session:

. $PROFILE

The PowerShell scripts mirror the bash versions tool-for-tool, and bash aliases become PowerShell functions of the same name (e.g. node-docker, phpcs-drupal). See the dedicated PowerShell page for full setup details and platform-parity notes.

Some tool families (Go, Rust, Ruby, Images, AI tools, Internet tools, Linux tools) live in their own file and aren’t sourced automatically — see their docs pages for the extra source line you need.

Run a command#

Lets try with a simple command. Here is some bad css.

#id {color: brown}
  1. Save this to a file… I’ll call it bad.css.
  2. Run stylelint-docker on it:
➜  ~ stylelint-docker bad.css
  1. Get stylelint output.
➜  ~ stylelint-docker bad.css

bad.css
 1:6   ✖  Expected single space after "{"  block-opening-brace-space-after
          of a single-line block
 1:12  ✖  Expected single space after ":"  declaration-colon-space-after
          with a single-line declaration
 1:16  ✖  Expected single space before     block-closing-brace-space-before
          "}" of a single-line block
 1:16  ✖  Expected a trailing semicolon    declaration-block-trailing-semicolon

--- Stylelint Complete ---
  1. Win o’clock!

Updating#

cd ~/.docker-devtools
git pull

Doing more#

There is more you can do, you are just starting… So, lets keep going!