• Stars
    star
    577
  • Rank 77,363 (Top 2 %)
  • Language
    PowerShell
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Various Vagrant envs with Windows 2019/10 and Docker, Swarm mode, LCOW, WSL2, ...

docker-windows-box

This repo is a collection of various Vagrant environments to work with Windows Containers on a Windows Server 2019 or Windows 10 VM.

There are different Vagrantfiles for each scenario:

Introduction

This repo has started with a single Vagrantfile that is explained below. As you can see there are several interesting setups here as well in the sub folders.

Have a look at my blog posts how to Setup a local Windows 2016 TP5 Docker VM and Adding Hyper-V support to 2016 TP5 Docker VM for more details. I also can recommend a more up to date guide Getting started with Windows Containers by @glennsarti

After provisioning the box has the following tools installed:

  • Windows Server 2019 with Docker Engine 18.09.0 and client
  • docker-machine 0.16.0
  • docker-compose 1.23.0
  • (Docker Tab completion for PowerShell (posh-docker))
  • Chocolatey
  • Git command line
  • Git Tab completion for PowerShell (posh-git)
  • SSH client

Optionally you can create a Hyper-V Docker Linux machine and have a multi architecture experience in one VM.

Tested with Vagrant 2.1.2, VMware Fusion Pro 10.1.3 on a MacBookPro with Retina display. The Vagrant box will be started in fullscreen mode also with Retina support.

You can learn and play a lot of scenarios with it:

Future work will be a Docker Swarm with both Linux and Windows Docker Engines...

Get the base box

First register to evaluate Windows 2019, but you don't need to download the ISO manually.

The Vagrant base box is available in Vagrant Cloud https://app.vagrantup.com/StefanScherer, these are all eval versions of Windows Server 2019 or Windows 10.

Vagrant will download the base box if it's not available locally, a vagrant box list shows which boxes you already have downloaded.

Install Vagrant reload plugin

As we need to reboot the VM once during the provisioning, you will need an additional Vagrant plugin

vagrant plugin install vagrant-reload

Spin up the box

To start the VM with Vagrant run this command

vagrant up

You only have to logout and login once to have the Docker tools in user vagrant's PATH.

Create some Windows Docker Container images

You may clone my dockerfiles-windows repo and create some container images.

git clone https://github.com/StefanScherer/dockerfiles-windows
cd dockerfiles-windows
cd node
.\build.ps1

Test the nightly Windows Docker Engine

You can update the Docker Engine with the script

C:\update-container-host.ps1

This will stop the Docker service, download the nightly build from https://master.dockerproject.org and restart the service.

Create a Linux Docker machine in Hyper-V

If you want to try out multi architecture you also use docker-machine to create a Linux Docker Engine running in Hyper-V. I have prepared a script that will set up everything as there are some known issues.

C:\vagrant\scripts\create-hyperv-linux-docker-machine.ps1

This PowerShell script creates a Docker machine and updates Docker Engine to the latest so that the Windows Docker client is able to communicate with the Linux Docker Engine.

Use the Linux Docker machine

Open a PowerShell terminal as an administrator and select the Linux Docker machine with

docker-machine env --shell powershell | iex

Now run your first busybox container with

docker run -it busybox uname -a

Windows Docker Swarm demo

See subdirectory swarm-demo

Use Vagrant to control your box

From your host control your Vagrant box with the usual Vagrant workflow:

  • vagrant up
  • vagrant halt
  • vagrant destroy -f
  • vagrant snap take
  • vagrant snap rollback
  • ...

Writing the installation script for the Hyper-V Docker machine the snapshot functions helped me a lot to test the script again and again.

More Repositories

1

dockerfiles-windows

Various Dockerfiles for Windows Containers
JavaScript
1,077
star
2

windows-docker-machine

Work with Windows containers and LCOW on Mac/Linux/Windows
PowerShell
1,070
star
3

docker-cli-builder

Build Docker CLI for Windows
Dockerfile
248
star
4

adfs2

Multi Vagrant environment with Active Directory
PowerShell
142
star
5

swarm-monitor

Monitor a Docker Swarm with Blinkt! LED
JavaScript
49
star
6

dotfiles

My dotfiles for Mac / Linux boxes and WSL
Shell
37
star
7

dotfiles-windows

My "dotfiles" for Windows PowerShell, like dotfiles on unix
PowerShell
27
star
8

ghost-buster-docker

Run Ghost blog in Docker, and run Buster to deploy to GitHub pages
HTML
26
star
9

docker-at-home

Things I run at home on Raspberry Pi in Docker containers
Shell
25
star
10

rpi-ubuntu

How to run Ubuntu with Docker on Raspberry Pi 3/4
25
star
11

windows-docker-workshop

Docker on Windows workshop
PowerShell
24
star
12

basebox-slave

Build Vagrant baseboxes in vCloud with Packer, for vCloud, VMware and VirtualBox
Ruby
22
star
13

winspector

Inspect Windows Docker images to check sizes and base layers
JavaScript
20
star
14

docker-windows-azure

Deploy a Windows "Docker-Machine" on Azure
PowerShell
19
star
15

windows-docker-desktop-box

Vagrant box to test Docker Desktop with Linux/Windows containers
17
star
16

packer-builder

Packer builder for Vagrant boxes
Shell
16
star
17

stefanscherer.github.io

Just my techie notes.
HTML
14
star
18

pwned-passwords

Docker image to search for pwned passwords
Shell
13
star
19

vagrant-sandbox

My Vagrantfiles for sandbox tests
Ruby
11
star
20

choco-packer

Chocolatey 'packer' package
PowerShell
11
star
21

consul-agent

Consul MSI installer to install a Consul agent as a Windows service
PowerShell
11
star
22

pfsense-packer

Build a pfSense box with Packer
11
star
23

vagrant-vcloud-box

Ubuntu Desktop with preinstalled vagrant-vcloud plugin to work with vCloud
Shell
10
star
24

insider-docker-machine

Windows Server 2016 Insider with Docker (and LCOW)
PowerShell
10
star
25

rebase-docker-image

Rebase a dockerized Windows app to a newer Windows Docker base image.
JavaScript
10
star
26

windows10-docker-swarm

Windows 10 Insider + Docker swarm-mode
PowerShell
9
star
27

mac-dev-box

Mac OSX developer box the Vagrant way - now with Retina display
Shell
7
star
28

rpi-forked-daapd

Dockerized iTunes server for the Raspberry Pi
HTML
7
star
29

choco-docker-cli

Chocolatey package "docker-cli" for the Docker CLI
PowerShell
7
star
30

logbook

Installation logbooks of my machines
7
star
31

docker-rpi-traffic-light

Dockerized traffic light app running on a Raspberry Pi
Python
6
star
32

chocolateyfest-talk

Dockerfiles for the talk at Chocolatey Fest 2018
JavaScript
6
star
33

choco-vagrant-vmware-utility

Chocolatey package for the Vagrant VMware Utility
PowerShell
5
star
34

mint

Packer template for Linux Mint
Shell
5
star
35

choco-vmwareworkstation

Chocolatey packages for VMware Workstation
PowerShell
5
star
36

esxi-playground

ESXi 6.0 + Windows client as a playground
Shell
5
star
37

atmega32u4strip

Small LED strip project with Adafruit Atmega32u4 breakout board
Processing
5
star
38

node-rfc-docker

Example to use node-rfc in a Docker container
JavaScript
4
star
39

choco-docker-compose

Chocolatey 'docker-compose' package
PowerShell
4
star
40

java-ide

Eclipse IDE for Java JEE Developers in an Ubuntu 12.04 LTS box
Shell
4
star
41

trinketstrip

A small LED project with Adafruit Trinket and NeoPixel strip
Arduino
4
star
42

gitrob-box

gitrob in a vagrant box
Shell
4
star
43

choco-archiver

Archiver tool as Chocolatey package - Easily create and extract .zip, .tar, .tar.gz, .tar.bz2, .tar.xz, .tar.lz4, .tar.sz, and .rar (extract-only) files with Go
PowerShell
4
star
44

fwe-fog

FWE FOG-Server configuration and scripts
PowerShell
4
star
45

azurepipelinetest

Test Azure Pipelines from a GitHub repo
Go
4
star
46

sles-vm

Virtual machine templates for SuSE Enterprise Linux (SLES)
Shell
3
star
47

chocolatey-packages

My Chocolatey Package Repository
PowerShell
3
star
48

image-builder-raspbian

Build and test Raspberry Pi SD card image in the cloud
Ruby
3
star
49

RFduino-guide

Quick starter guide for RFduino
3
star
50

packer-atlas-example

Automate building Vagrant Boxes with Packer in Atlas
Shell
3
star
51

choco-manifest-tool

Chocolatey package for the manifest-tool
PowerShell
3
star
52

circle2test

Test job workflows in CircleCI 2.0
Go
3
star
53

choco-docker-machine-vmwareworkstation

Chocolatey 'docker-machine-vmwareworkstation' package
PowerShell
3
star
54

azure-docker-swarm

Terraform template to spin up a Docker Swarm in Azure
HCL
3
star
55

appetizer

Chocolatey Fest appetizer app 🍫
JavaScript
3
star
56

choco-packer-post-processor-vagrant-vmware-ovf

Chocolatey 'packer-post-processor-vagrant-vmware-ovf' package
PowerShell
2
star
57

vcloud-scenarios

Some vagrant-vcloud scenarios
Ruby
2
star
58

choco-docker-machine-vmware

Chocolatey package for the docker-machine-vmware plugin
PowerShell
2
star
59

maketest

maketest
Makefile
2
star
60

talks

Slides for various presentations
HTML
2
star
61

caddy-builder

Fork of a caddy builder
Go
1
star
62

compose-builder

build docker-compose for ARM
1
star
63

iruby-box

IRuby in an Ubuntu box
Shell
1
star
64

lrtimelapse-box

Time lapse workflow on a Mac with Lightroom + LRTimelapse
Shell
1
star
65

test-vagrant-update

This repo is for testing a vagrant update 1.5.3 -> 1.6.2
PowerShell
1
star
66

rpi-gh

Raspberry Pi am Gymnasium HΓΆchstadt
HTML
1
star
67

mac-docker-desktop-box

Vagrant box to test Docker Desktop for Mac in a Fusion VM
1
star
68

node-app-example

Test single exe Node.js application with AppVeyor
JavaScript
1
star
69

jenkins-debian-glue-box

Setup an Ubuntu box with jenkins-debian-glue
1
star
70

cups-cucumber-test

Test cups with vagrant-cucumber
Shell
1
star
71

arduino-ide

Arduino IDE running on Ubuntu 12.04
1
star
72

rpi-ledtest

Play with NeoPixel LED strips on Rapsberry Pi with Python
Python
1
star
73

tuxpaint-box

Tux Paint for kids is only a vagrant up away
1
star
74

win-getaddrinfo

Build a static Windows binary
C
1
star
75

choco-mkcert

Chocolatey package for the mkcert developer tool
PowerShell
1
star
76

win-patch-iojs

Windows tool to monkey-patch the iojs.exe to run in a Windows Docker container
C
1
star
77

rpi-kitematic

Run Kitematic in a Docker Container on your Raspbery Pi
Shell
1
star
78

appveyortest

Test AppVeyor Windows builder
1
star
79

serverspec-on-appveyor

Run serverspec tests on AppVeyor
Ruby
1
star
80

windows-docker-workshop-chat

Gitter chat during the Docker on Windows workshop
1
star
81

chat-example

Node.js chat-example with some Vagrant boxes
JavaScript
1
star
82

panamax-vcloud

Start a Panamax instance in VMware vCloud
Shell
1
star
83

travis-windows-test

Test TravisCI with Windows builder
1
star
84

PiEmulator

Manual on how to set up a Raspberry Pi emulator
1
star