how to setup Docker in a Windows, Linux or Mac.pdf
1. Docker Editions
• Learn about the various (dozen+) Editions of Docker
• Learn which to use for this course
• Learn Docker CE vs. EE
• Learn Stable vs. Edge releases
2. Docker Editions at store.docker.com
• Docker is no longer just a "container runtime"
• Docker moves fast, it matters how you install it
• Linux (different per distro, don’t use default package)
• Docker Desktop (Recommended for Windows and Mac)
• Docker Toolbox (Legacy for Win10 Home/Win7/Win8)
3. Community vs. Enterprise
• Docker Community (free) vs. Docker Enterprise (paid)
• Old Name "EE" = Enterprise Edition (same thing)
• Windows Server 2016 comes with Enterprise Basic
• Linux servers are a target for Enterprise
• Enterprise also gets you GUI apps like DTR and UCP
• Developers and Sysadmins use Community locally
4. Stable vs. Edge
• Edge (beta) released monthly, Stable quarterly
• Edge gets new features first, but only supported for a month
• Stable rolls in three months of Edge features, EE supported
longer
5. Docker on Windows
• Learn the two types of containers Windows can run
• Learn which Docker Edition to install on your Windows version
• Learn differences between Windows 10 and Windows Server
2016
6. Docker on Windows Overview
• Two Types of Containers: Linux Containers and Windows
Containers
• Linux Containers still default, when I say "containers" I mean
Linux
• Best experience: Docker for Windows, but Win10 Pro/Ent only
• Win7/8/8.1 or Win10 Home should use Docker Toolbox
• Windows Server 2016 also supports Windows Containers
• Getting better all the time
• e.g. Native Linux containers coming soon
7. Docker on Windows 10 Pro/Ent
• Use Docker for Windows, from store.docker.com
• More features then just a Linux VM
• Uses Hyper-V with tiny Linux VM for Linux Containers
• PowerShell native
8. Docker for Mac
• Use Docker for Mac, from store.docker.com
• More features then just a Linux VM
• Uses "xhyve" with tiny Linux VM for Linux Containers
• Terminal/iTerm native
• PowerShell native
9. Docker on Windows 7/8 and 10 Home
• Use Docker Toolbox, not as fancy as Docker for Windows
• Like others, download at store.docker.com
• Runs a tiny Linux VM in VirtualBox via docker-machine
• Uses a bash shell to make it more like Linux/Mac options
• Does not support Windows Containers
• Must put all your code in C:Users<your-username>
10. Docker on Windows Server 2016
• Windows Server 2016 supports native Windows Containers
• ”Docker for Windows” runs on Win 2016 but not required
• Only do this for when you run Win 2016 locally for dev/test. NOT for
prod
• No options for previous Windows Server versions
• Hyper-V can still run Linux VM's (that can run Docker) just fine
11. Docker for Windows: Setup
• Install Docker
• Tweak Docker for Windows settings
• Clone my GitHub repo
• Get a code editor
• Tweak your terminal and shell (optional)
12. Docker for Windows Tips
• PowerShell Command Completion: posh-docker
• https://docs.docker.com/docker-for-windows/#set-up-tab-completion-in-powershell
• Code paths enabled for Bind Mounts (C:Users by default)
• Bind Mounts work for code (but often not databases)
• Backup option: use docker-machine create --driver hyperv
• https://docs.docker.com/machine/drivers/hyper-v/
• Great Dockerfile/Compose file editor: Visual Studio Code
• https://code.visualstudio.com/
• Great Terminal UI replacement: cmder
• http://cmder.net/
• Great info and troubleshooting/FAQ
• https://docs.docker.com/docker-for-windows/
13. Docker Toolbox on Windows: Setup
• Install Docker
• Clone my GitHub repo
• Start the Docker Quickstart Terminal
• Tweak Docker VM settings
• Get a code editor
• Tweak your terminal and shell (optional)
14. Docker Toolbox on Windows: Tips
• Use the Docker Quickstart Terminal to start with
• In background it auto-creates and auto-starts VM
• Defaults to bash shell
• Code paths enabled for Bind Mounts work in C:Users only
• Bind Mounts work for code (but often not databases)
• Re-create Linux VM or create more with docker-machine
• Great Dockerfile/Compose file editor: Visual Studio Code
• https://code.visualstudio.com/
• Great Terminal UI replacement: cmder
• http://cmder.net/
15. Docker on macOS Overview
• Docker for Mac
• Requires Yosemite 10.10.3 (2014 release)
• Yosemite works with 2007-2008 Mac's and newer
• Docker Toolbox
• For Snow Leopard, Lion, Mountain Lion (10.6-10.8)
• Docker in a Linux VM
• Docker in a Windows VM
• Not usually possible, only works with Vmware Fusion
• Don't use homebrew (brew install docker), it's docker CLI only
16. Docker for Mac: Setup
• Install Docker
• Tweak Docker for Mac settings
• Clone my GitHub repo
• Get a code editor
• Tweak your terminal and shell (optional)
17. Docker for Mac Tips
• Bash Command Completion
• https://docs.docker.com/docker-for-mac/#installing-bash-completion
• Code paths enabled for Bind Mounts (/Users by default)
• Bind Mounts work for code and (usually) databases
• Run more nodes: docker-machine create --driver
• Fusion, VirtualBox, Parallels, etc. https://docs.docker.com/machine/drivers/
• Great Dockerfile/Compose file editor: Visual Studio Code
• https://code.visualstudio.com/
• Great Terminal replacement: iTerm2
• https://www.iterm2.com/
• Great info and troubleshooting/FAQ
• https://docs.docker.com/docker-for-mac/
• My Shell Setup (iTerm2 + oh-my-zsh + much more)
• http://www.bretfisher.com/shell
18. Docker on Linux
• Easiest install/setup, best native experience
• Three main ways to install: script, store, or docker-machine
• get.docker.com script (latest Edge release)
• curl -sSL https://get.docker.com/ | sh
• store.docker.com has instructions for each distro
• RHEL officially only supports Docker EE (paid), but CentOS will work
• Installing in a VM, Cloud Instance, all are the same process
• May not work for unlisted distros (Amazon Linux, Linode Linux, etc.)
• Don't use pre-installed setups (Digital Ocean, Linode, etc.)
19. Docker for Linux: Setup
• Install Docker
• Add your user to docker group
• Clone my GitHub repo
• Get a code editor
• Tweak your terminal and shell (optional)
20. Docker for Linux Tips
• After installing Docker, also get docker-compose and docker-
machine
• https://docs.docker.com/machine/install-machine/
• https://docs.docker.com/compose/install/
• Run more nodes: docker-machine create --driver
• VirtualBox, AWS, etc. https://docs.docker.com/machine/drivers/
• Great Dockerfile/Compose file editor: Visual Studio Code
• https://code.visualstudio.com/
• Bash command completion just works