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.
Clone docker-devtools-aliases (recommended)#
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-devtoolsAdd to your shell#
Bash / zsh#
Add the following line to your .bashrc or .zshrc:
source ~/.docker-devtools/docker-devtools.shThen reload your shell:
source ~/.bashrc # or: source ~/.zshrcPowerShell#
Add the following line to your PowerShell profile ($PROFILE):
. "$HOME/.docker-devtools/docker-devtools.ps1"Then reload your profile, or open a new session:
. $PROFILEThe 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}- Save this to a file… I’ll call it
bad.css. - Run stylelint-docker on it:
➜ ~ stylelint-docker bad.css- 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 ---- Win o’clock!
Updating#
cd ~/.docker-devtools
git pullDoing more#
There is more you can do, you are just starting… So, lets keep going!