Skip to content

Setup Windows

danmasta edited this page Feb 12, 2018 · 1 revision

Docker - Windows

Install

Install docker native for Windows (v17.06 or later), we will be following a setup example similar to what they have here: https://docs.docker.com/machine/drivers/hyper-v/

Hyper-V

Enable Hyper-V in Bios

Enable Hyper-V in Windows by searching for 'Turn Windows features on and off'

Make sure the Hyper-V options are enabled

Virtual Switch

You will also need to create a virtual switch to use docker on windows

Search for and open the 'Hyper-V Manager'

Open 'Virtual Switch Manager' in the actions pane on the right side

Make sure External is highlighted, then click 'Create Virtual Switch'

Select your NIC, usually default is fine, and set the name something like 'external-switch' and click OK

Docker Machine

You need to create at least a default docker machine, you can use the following script

docker-machine create -d hyperv --hyperv-virtual-switch 'external-switch' default

Note: when interacting with docker-machines with hyperv drivers you will need to use an elevated/admin shell

AWS

Install

First add python to your path, then use pip to install aws cli and eb cli

pip install awscli awsebcli --upgrade --user

Configure

Next you need to configure aws cli with your credentials so you can access aws tools

aws configure

It will look like this

AWS Access Key ID [None]: <KEY>
AWS Secret Access Key [None]: <SECRET>
Default region name [None]: us-east-1
Default output format [None]: json

You will be asked for your access key and secret

Now login to your docker registry by running the get-login command

aws ecr get-login --no-include-email --region us-east-1

This will output the docker login command which looks something like this

docker login -u AWS -p <KEY> https://<ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com

Copy and paste that command into your shell to complete login.

Note: the login cmd is run automatically each time you deploy, but it's still good to test it right now to make sure you have everything working

Create an application in elastic beanstalk Then go to IAM and attach the following policies to the aws-elasticbeanstalk-ec2-role

  • AmazonEC2ContainerRegistryReadOnly
  • AmazonAPIGatewayPushToCloudWatchLogs

Create an ECR Registry for your app

Create log groups in cloudwatch for your app (optional)

These do two things: let your eb environments pull from your private ecr registry, gives your ec2 instances the ability to push logs to cloudwatch

Now you are ready to setup an application and deploy!

Clone this wiki locally