<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>inkscape &#8211; Shanavas</title>
	<atom:link href="/tag/inkscape/feed/" rel="self" type="application/rss+xml" />
	<link>/</link>
	<description>Home!</description>
	<lastBuildDate>Tue, 27 Sep 2016 15:36:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.6.1</generator>

<image>
	<url>http://i0.wp.com/www.shanavasv.com/wp-content/uploads/2016/08/favicon.png?fit=16%2C16</url>
	<title>inkscape &#8211; Shanavas</title>
	<link>/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">115605667</site>	<item>
		<title>Running Linux apps in MacOS using docker</title>
		<link>/running-linux-apps-in-macos-using-docker/</link>
		<comments>/running-linux-apps-in-macos-using-docker/#comments</comments>
		<pubDate>Sat, 20 Aug 2016 17:18:59 +0000</pubDate>
		<dc:creator><![CDATA[shanavas]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[inkscape]]></category>
		<category><![CDATA[MacOS]]></category>

		<guid isPermaLink="false">/?p=278</guid>
		<description><![CDATA[Docker is an excellent tool to deploy apps to servers with tight control over its...]]></description>
				<content:encoded><![CDATA[<p><img class="alignright wp-image-286" src="http://i0.wp.com/www.shanavasv.com/wp-content/uploads/2016/08/docker-engine.png?resize=200%2C196" alt="docker-engine" srcset="http://i0.wp.com/www.shanavasv.com/wp-content/uploads/2016/08/docker-engine.png?w=250 250w, http://i0.wp.com/www.shanavasv.com/wp-content/uploads/2016/08/docker-engine.png?resize=60%2C60 60w" sizes="(max-width: 200px) 100vw, 200px" data-recalc-dims="1" /><a href="https://www.docker.com/" target="_blank">Docker</a> is an excellent tool to deploy apps to servers with tight control over its environment. Apps run inside containers, and have access to a file system, libraries and operating system pre-defined by a Dockerfile. Docker is also available for Mac and PC, which means we can run linux apps on these systems without installing a virtual machine.</p>
<p>Since the apps require a linux environment, docker does not run natively in Mac and PC. Rather, it sets up a linux virtual machine and runs docker engine inside that. Before version 1.12, docker on Mac required installation of virtualbox and docker-machine to manage this linux virtual machine inside which the containers are run. However, latest version of <a href="https://docs.docker.com/docker-for-mac/" target="_blank">docker for mac</a> uses <a href="https://github.com/docker/hyperkit" target="_blank">hypervisor</a> to run operating system as a service and thus has more native feel. Lets install it using <a href="http://brew.sh/" target="_blank">Homebrew</a>:</p>
<pre style="background: #f9f9f9; color: #080808;">brew cask install docker
</pre>
<p>Run the app from the launcher and it will go through the initial setup process. We can now interact with the docker daemon through the shell.</p>
<p>Next, we will pull a debian image and install gimp and inkscape in it. Open a terminal and create a <code>Dockerfile</code> inside a folder called <code>apps</code>.</p>
<pre style="background: #f9f9f9; color: #080808;">FROM debian:jessie
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive \
  apt-get install -y -q gimp inkscape \
  ttf-dejavu --no-install-recommends
RUN rm -rf /var/lib/apt/lists/<span style="color: #794938;">*</span>
CMD <span style="color: #0b6125;">"gimp"</span>
</pre>
<p>Next, build the docker image called apps:</p>
<pre style="background: #f9f9f9; color: #080808;">docker build -t apps <span style="color: #693a17;">.</span>
</pre>
<div class='row'><div class='col-sm-6'><figure>
        				<a href="/wp-content/uploads/2016/08/docker-term.png" class="fancybox-media" data-rel="portfolio">
        					<div class="text-overlay">
        					  <div class="info">docker commands</div>
        					</div>
        					<img width="618" height="636" src="http://i1.wp.com/www.shanavasv.com/wp-content/uploads/2016/08/docker-term.png?fit=618%2C636" class="attachment-large size-large" alt="docker commands" srcset="http://i1.wp.com/www.shanavasv.com/wp-content/uploads/2016/08/docker-term.png?w=618 618w, http://i1.wp.com/www.shanavasv.com/wp-content/uploads/2016/08/docker-term.png?resize=292%2C300 292w" sizes="(max-width: 618px) 100vw, 618px" data-attachment-id="305" data-orig-file="http://i1.wp.com/www.shanavasv.com/wp-content/uploads/2016/08/docker-term.png?fit=618%2C636" data-orig-size="618,636" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="docker-term" data-image-description="" data-medium-file="http://i1.wp.com/www.shanavasv.com/wp-content/uploads/2016/08/docker-term.png?fit=292%2C300" data-large-file="http://i1.wp.com/www.shanavasv.com/wp-content/uploads/2016/08/docker-term.png?fit=618%2C636" />
        				</a>
        			</figure></div></div>

<p>To run graphics inside docker containers, we will need X11 running on Mac. At the time of this writing the stable version of XQuartz (2.7.9) has a bug which prevents graphics forwarding. However, 2.7.10_beta2 works.</p>
<pre style="background: #f9f9f9; color: #080808;">brew cask install xquartz-beta
</pre>
<p>The stable version of xquartz may work if it is higher than 2.7.10. Check the version in home-brew by: <code>brew cask info quartz</code>.</p>
<p>Start XQuartz and allow connections from network clients in preferences &gt; security. Now the following commands should get gimp running:</p>
<pre style="background: #f9f9f9; color: #080808;">ip=<span style="color: #0b6125;">$(ifconfig <span style="color: #794938;">|</span> grep <span style="color: #0b6125;">"inet "</span> <span style="color: #794938;">|</span> grep -v 127.0.0.1 <span style="color: #794938;">|</span> awk <span style="color: #0b6125;">'{print $2}'</span>)</span>
xhost + <span style="color: #234a97;">$ip</span>
docker run --rm -it -e DISPLAY=<span style="color: #234a97;">$ip</span>:0 -v <span style="color: #234a97;">$HOME</span>/Downloads:/root/Downloads apps
</pre>
<p>This will also share the ~/Downloads folder with the container. To run inkscape:</p>
<pre style="background: #f9f9f9; color: #080808;">docker run --rm -it -e DISPLAY=<span style="color: #234a97;">$ip</span>:0 -v <span style="color: #234a97;">$HOME</span>/Downloads:/root/Downloads apps inkscape
</pre>
<p>Any changes made to gimp itself will be lost when the app is closed. Any additional plugins or customizations should be included in the Dockerfile to make them permanent.</p>
]]></content:encoded>
			<wfw:commentRss>/running-linux-apps-in-macos-using-docker/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">278</post-id>	</item>
	</channel>
</rss>
