Skip to content

Instantly share code, notes, and snippets.

@kordless
Forked from MarcelMue/file.md
Last active August 29, 2015 14:17
Show Gist options
  • Save kordless/e1a6c9853db64c2668a2 to your computer and use it in GitHub Desktop.
Save kordless/e1a6c9853db64c2668a2 to your computer and use it in GitHub Desktop.

#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 executing curl -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.gzat the same location
  • if you use the ls command you should see a executable named swarmin 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 /exand creating a new file with touch test. A new file called test 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 binfor easy access like this sudo cp swarm /usr/local/bin/
    • if everything has worked correctly, you should be able to use swarm infoto see if the giantswarm cluster is reachable

####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 chose swarm 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment