#Using the giantswarm CLI on Windows with boot2docker without a additional VM
####prerequisites:
- Boot2docker should be running on your system and you should have access to it with
boot2docker ssh
- A filepath of your windows system should be mirrored in boot2docker (eg windows
C:\\Users\Username
should be boot2docker/c/Users/Username
) - Have a decent console setup to make the following steps easier ( I use Console 2)
####Setup
- Switch to your boot2docker with
boot2docker ssh
and download the swarm cli to a location mirrored by windows (eg your project folder) by executingcurl -O http://downloads.giantswarm.io/swarm/clients/0.15.0/swarm-0.15.0-linux-amd64.tar.gz
- run
tar xzf swarm-0.15.0-linux-amd64.tar.gz
at the same location - if you use the
ls
command you should see a executable namedswarm
in your folder - create a docker container using the following command
docker run -i -t -v /c/somepath/somefolder:/ex --name=swarm ubuntu
/c/somepath/somefolder
should contain the `swarm executable you just created!- note that
/c/somepath/somefolder
HAS to be an absolute path! /ex
is just the foldername where/c/somepath/somefolder
will be mirrored to- test if your setup was correct by changing directory in your container to
/ex
and creating a new file withtouch test
. A new file calledtest
should appear in you container, your boot2docker and your windows system.
- install curl on your container with
sudo apt-get install curl
- copy your swarm executable into your
bin
for easy access like thissudo cp swarm /usr/local/bin/
- if everything has worked correctly, you should be able to use
swarm info
to see if the giantswarm cluster is reachable
- if everything has worked correctly, you should be able to use
####Usage:
- You can easily detach your container by pressing
CTRL + P -> CTRL + Q
- You can attach your container again be using
docker attach swarm
(If you choseswarm
as the name for your container)
####Example workflow:
- Edit some files with a texteditor in your windows OS
- go to boot2docker and check if everything works as intended
- attach your container with swarm cli in it
- push to giantswarm
- detach your container
####Pros:
- much easier to use than a full blown VM and incredibly fast to detach/attach
- No need to copy files because the files you are working on are mirrored through boot2docker into your container
####Cons:
- Container is currently not easy to replace, because some setup steps have to be repeated whenever you want to get a new container