In a previous post, we detailed how to use Chocolatey to install Turbo VM. (You can read it here: https://blog.turbo.net/deploying-turbo-with-chocolatey/)
In this post, we will detail how you can leverage Chocolatey to create Turbo images. This is powerful since it means any application with a Chocolatey package can be used to create a Turbo container. As of this writing there are nearly 3,000 distinct Chocolatey packages available.
We will be using Notepad++ in this example.
First, run the command window as an administrator and run the turbo login command.
> turbo login
When prompted, enter your login credentials. Once you have logged in, enter the following command.
> turbo new --name=choconotepad clean --using=chocolatey/chocolatey
This creates a new container named choconotepad. The --using flag lets us use Chocolatey within the container but remove it from the final image. This keeps the resulting image as lightweight as possible. In some cases other dependencies may be required to install the chocolate package such as PowerShell. In which case, you may need to use something like: --using=chocolatey/chocolatey,microsoft/powershell.
In the new command window that opens run:
> choco install notepadplusplus -y
The Notepad++ package should start to download and install within the container.
The package install should complete successfully.
When the install has completed, close the command window.
In the original command window used to create our VM, we commit our image.
> turbo commit choconotepad notepadplusplus --startup-file="C:\Program Files (x86)\Notepad++\notepad++.exe"
Note we set the appropriate startup file using the --startup-file flag so the container runs Notepad++ on startup (rather than a command prompt containing Notepad++).
We can now test the image by launching it in a new container. In a command window, enter:
> turbo new notepadplusplus
Notepad++ should launch:
Now let’s save our work by pushing it to the hub.
> turbo push notepadplusplus
We now have a working image of Notepad++ created using an existing Chocolatey package! The image can now be run from your private hub using the run button or from the command window using turbo new hubname/notepadplusplus.