Tuesday, October 11, 2016

Using GUI apps from docker on Windows host

So, you're looking for a way to use GUI apps from your Linux docker machine running on your Windows host? I bet you thought this would be really hard or impossible but it's actually incredibly easy.

Instructions

  1. Install xming
    1. but don't launch xming
  2. Run your docker image with these extra parameters: -e DISPLAY={ip of docker virtual adapter}:0.0
    1. eg. docker run -e DISPLAY=192.168.99.1:0.0 -it quay.io/travisci/travis-
      node-js /bin/bash
  3. Find your xming folder and open X0.hosts
  4. Add the ip of the docker machine on a new line and save
    • docker should have displayed the ip when you opened your docker console 
    • alternatively you can simply try running the docker image and then locating the ip address at the bottom of the Xming log which can be found by right clicking on the Xming taskbar icon and choosing "View logs".
  5. Launch xming
  6. Run your GUI app from docker!

Disclaimer

I've only tested this with Firefox using a Windows 10 host.

Sources

windows 7 - How to use x11 forwarding with PuTTY
Running Linux GUI Apps in Windows (using cygwin/X)

Friday, May 20, 2016

Code Examples in OneNote the hard way


The final result will look like this:
spyOn(someObject, "someMethod").and.returnValue($q.resolve(someValue));
spyOn(someObject, "someMethod").and.returnValue($q.reject(someValue));


Steps:
  1. Create a table with one cell
  2. Select the cell
  3. Click Layout > Shading > black
  4. Paste or write your code example inside the cell
  5. Highlight the code
  6. Change font color to white
  7. Click Review > Language > Set proofing language
  8. Choose a language on the right that no-one on your team is likely to have installed
  9. Paint the strings, globals and keywords appropriately