- Install Docker Via Chocolatey
- Docker Install Chocolatey In Container
- Install Docker Windows Chocolatey
- Chocolatey is software management automation for Windows that wraps installers, executables, zips, and scripts into compiled packages. Chocolatey integrates w/SCCM, Puppet, Chef, etc. Chocolatey is trusted by businesses to manage software deployments.
- Install Chocolatey; Install a package (git) Install specific version of a package; Dockerfile; Introduction. We will introduce a Package Manager for Windows: Chocolatey. In automations, it is necessary to install various tools, softwares from command line. In this post, we will install git and osquery. Install Chocolatey. Open powershell console.
Containers are a great place to test your Chocolatey packages or even packages from another source. You don't have to waste time creating and tearing down vms and perhaps most importantly you can avoid those 'It worked on my machine' problems. Docker is a constant grind to upgrade. Server guys loves Chocolatey since they can script the install of chocolatey and the necessary software.
The Docker tools are useful on a Windows machine to build and run applications in Linux containers locally in a VM or in the cloud. With the Chocolatey package manager you can install all the Docker tools you need to get started.
If you don't know what a shell window is then you should have a look at the Docker Toolbox from Docker. But if you know and use a PowerShell or CMD shell window from time to time I'll guide you through the simple steps.
Let's get Chocolatey
Chocolatey is an open source project to provide a package manager for Windows as you might know it from Linux distro. You can install many of your software on your Windows machine with it.
Just open chocolatey.org and search for eg. Chrome, Adobe Reader, or other tools you have installed manually in the past. You will find out fast that nearly everything could be installed with just the command
That makes Chocolatey really cool. It's like
apt-get, but for Windows. And the software is downloaded from the original places, the choco packages only contains the instructions where to download it and how to install it silent.
If you haven't installed Chocolatey already just open the homepage https://chocolatey.org and copy the simple command to your shell.
Docker Chocolatey packages
To see which Docker tools are available through Chocolatey packages, just open the Chocolatey homepage and search for docker.
The Chocolatey packages for the Docker tools are maintained by the community. But they are kept up-to-date, so you can update each tool soon after the official release.
At the moment you can install
- Docker Client
- Docker Machine
- Docker Compose
as well as a Docker Machine driver plugin for VMware Workstation.
To begin with Docker you need the Docker Client. Install it in a PowerShell or CMD shell window with
-y just auto-answers the question to run the install script.
Now we have the
docker command installed. Try it out with
docker --version for the installed version or
docker --help to see the usage. This client will be used to build and run Docker Containers.
The next step is to create a VM to run the Linux containers in it. Docker Machine is the right tool for that task. So we first install it with
Windows users can select between these three local hypervisors to run a Linux Docker Engine in it.
- VMware Workstation
All three hypervisors can be controlled by Docker Machine.
For Hyper-V follow the official guide how to install it on your machine.
Install Docker Via Chocolatey
VirtualBox can also be installed with Chocolatey, guess how
For VMware Workstation you also need the driver plugin and VMware Workstation if not already installed:
For VMware Workstation you enter your license before using it.
You also can create a VM in the cloud, Docker Machine has a lot of cloud drivers built in.
- Windows Azure
- Digital Ocean
- Google GCE
See the official guide Using Docker Machine with a cloud provider for more details.
Create a Docker Machine
After you have set up your local hypervisor or chosen the cloud provider you want to use, create a Docker Machine VM with the name
dev with one of these commands:
There are driver specific options to tweak the VM settings or the token to connect to your account in the cloud.
After a while you will have your local or remote Docker Machine up and running.
You can check the status of the machine(s) with
Connect to your Docker Machine
For the Docker Client you need some environment variables so that the Docker Client knows how to connect to your local or remote Docker Engine.
In PowerShell it is really easy to set these environments.
In the near future can skip the
--shell parameter as well to simplify this step.
After that you can control the Docker engine and start your first container, eg. this interactive shell
exit to terminate the container.
Congratulations! You have started your first container.
If you want to start more than one container that should work together you can use Docker Compose. It simplifies this task to setup a multi container application.
Please refer to the official Overview of Docker Compose guide to find out more.
Now you are ready to work from your Windows machine and control the world of Linux containers. In the near future you also can do this with Windows containers as well.
With just a few commands you get all the Docker tools installed on your Windows machine. And it fits into a single tweet:
Get the latest @Docker tools for #Windows: choco install dockerchoco install docker-machinechoco install docker-compose Done!
Docker Install Chocolatey In Container— Stefan Scherer (@stefscherer) 6. November 2015
Install Docker Windows Chocolatey
If you like this blog post please share it with a friend or leave a comment to give feedback or ask questions.