<?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>docker compose &#8211; Tomas&#039; log of stuff</title>
	<atom:link href="https://blog.fjetland.com/tag/docker-compose/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.fjetland.com</link>
	<description>Notes from the sysadmin trenches, on hobby photography, and anything else that comes to mind</description>
	<lastBuildDate>Thu, 26 May 2022 23:51:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Adding easy container management to Photon OS with Portainer</title>
		<link>https://blog.fjetland.com/2022/05/adding-easy-container-management-to-photon-os-with-portainer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adding-easy-container-management-to-photon-os-with-portainer</link>
					<comments>https://blog.fjetland.com/2022/05/adding-easy-container-management-to-photon-os-with-portainer/#comments</comments>
		
		<dc:creator><![CDATA[tomasf]]></dc:creator>
		<pubDate>Thu, 26 May 2022 23:46:14 +0000</pubDate>
				<category><![CDATA[Containers]]></category>
		<category><![CDATA[containers]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[docker compose]]></category>
		<category><![CDATA[photon os]]></category>
		<category><![CDATA[portainer]]></category>
		<category><![CDATA[system administration]]></category>
		<guid isPermaLink="false">http://blog.fjetland.com/?p=1424</guid>

					<description><![CDATA[Configuring Portainer Community Edition on a newly set up Photon OS install with configuration data stored on an NFS share]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large"><img fetchpriority="high" decoding="async" width="1024" height="536" src="http://blog.fjetland.com/wp-content/uploads/2022/05/Portainer_Illustrations_Crane20-20Hero20copy1-1024x536.png" alt="" class="wp-image-1431" srcset="https://blog.fjetland.com/wp-content/uploads/2022/05/Portainer_Illustrations_Crane20-20Hero20copy1-1024x536.png 1024w, https://blog.fjetland.com/wp-content/uploads/2022/05/Portainer_Illustrations_Crane20-20Hero20copy1-300x157.png 300w, https://blog.fjetland.com/wp-content/uploads/2022/05/Portainer_Illustrations_Crane20-20Hero20copy1-768x402.png 768w, https://blog.fjetland.com/wp-content/uploads/2022/05/Portainer_Illustrations_Crane20-20Hero20copy1.png 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>


<p>This is a follow-up to <a href="http://blog.fjetland.com/2022/05/setting-up-photon-os-4-as-a-docker-host-vm-on-vsphere-7/" data-type="post" data-id="1401">my post</a> on setting up Photon OS on vSphere as a lightweight VM to run containers on. By the end of that post, I have the OS up and running with Docker Engine in place and enabled. This post will add simple, graphical container management to the host through <a href="https://www.portainer.io/" target="_blank" rel="noopener">Portainer</a>.</p>



<p>You might ask, &#8220;Isn&#8217;t the point of containerized workloads, infrastructure as code, etc., that you can use the command line to manage your workloads?&#8221;. And you might be right. But right now, I&#8217;m not building dev environments; I&#8217;m bringing up relatively static components, prepackaged containers, that will deliver some sort of service in my network. And I won&#8217;t be deploying, destroying and redeploying these daily. And since my memory has always been terrible, and I have more than enough I need to remember from my actual work, I&#8217;d have to be looking up these things all the time. So sometimes, a friendly, intuitive GUI is just a better option. The nice thing here, of course, is that I can still do both, choosing whatever works best for me at any given time.</p>



<p>Portainer comes in two different flavours, the free <a href="https://hub.docker.com/r/portainer/portainer-ce" target="_blank" rel="noopener">Community Edition</a>, and the commercial <a href="https://hub.docker.com/r/portainer/portainer-ee" target="_blank" rel="noopener">Business Edition</a>. The Business Edition is available for <a href="https://www.portainer.io/pricing/take5" target="_blank" rel="noopener">free for fewer than 5 nodes</a>; for now, I&#8217;m installing Community Edition, but I might look at the BE too eventually.</p>



<p>Because I want the host VM to be &#8220;disposable&#8221; so I can rebuild it and the contents for whatever reason, I needed somewhere to put the persistent data of the containers, including the Portainer management container. So I made an NFS share on my NAS called conda because it&#8217;s for container data, but I&#8217;m too lazy to type it out.</p>



<p>Since the minimal install of Photon OS that you get when deploying the OVA doesn&#8217;t include the nfs-utils package that I need to mount the share, the first step is to install that using tdnf:</p>



<pre class="wp-block-code"><code>tdnf install nfs-utils</code></pre>



<p>With that done, I can make somewhere to mount the NFS share; mkdir<em>/var/conda</em> ought to do the trick. If my NAS has IP 198.51.0.10, this will accomplish what I want:</p>



<pre class="wp-block-code"><code>mount -t nfs 198.51.0.10:/conda /var/conda</code></pre>



<p>Now we have somewhere persistent to store the configuration or user data of the containers, it&#8217;s time to deploy Portainer. </p>



<pre class="wp-block-code"><code>docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/conda/portainer_data:/data portainer/portainer-ce:latest</code></pre>



<p>This will pull the latest community edition of Portainer, and store the config data in /portainer_data on my NAS share, mounted in /var/conda on the VM. Once done, it should be accessible on port 9443 on the IP I assigned to the Photon OS instance. Set a password, and you&#8217;re up and running:</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="381" src="http://blog.fjetland.com/wp-content/uploads/2022/05/image-3-1024x381.png" alt="" class="wp-image-1427" srcset="https://blog.fjetland.com/wp-content/uploads/2022/05/image-3-1024x381.png 1024w, https://blog.fjetland.com/wp-content/uploads/2022/05/image-3-300x112.png 300w, https://blog.fjetland.com/wp-content/uploads/2022/05/image-3-768x286.png 768w, https://blog.fjetland.com/wp-content/uploads/2022/05/image-3.png 1466w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>The home screen of my fresh Portainer install</figcaption></figure>



<p>From here, you can deploy and manage both single containers, and you can do Docker Compose installs using what Portainer calls stacks. I&#8217;m not going to do an in-depth discussion on Portainer features, mainly since I just started using it, but <a href="https://www.youtube.com/c/PortainerIO/videos" target="_blank" rel="noopener">their Youtube channel</a> is an excellent source of info. Once I have stuff to discuss, I might do another post.</p>



<p>I&#8217;d like to highlight the Stacks feature, which is basically a UI for Docker Compose, where you can type your YAML right in their web editor, upload it as a file, or connect to a repository.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="1024" src="http://blog.fjetland.com/wp-content/uploads/2022/05/image-4-1024x1024.png" alt="" class="wp-image-1430" srcset="https://blog.fjetland.com/wp-content/uploads/2022/05/image-4-1024x1024.png 1024w, https://blog.fjetland.com/wp-content/uploads/2022/05/image-4-300x300.png 300w, https://blog.fjetland.com/wp-content/uploads/2022/05/image-4-150x150.png 150w, https://blog.fjetland.com/wp-content/uploads/2022/05/image-4-768x769.png 768w, https://blog.fjetland.com/wp-content/uploads/2022/05/image-4-80x80.png 80w, https://blog.fjetland.com/wp-content/uploads/2022/05/image-4-320x320.png 320w, https://blog.fjetland.com/wp-content/uploads/2022/05/image-4.png 1244w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>The Stacks feature of Portainer</figcaption></figure>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fjetland.com/2022/05/adding-easy-container-management-to-photon-os-with-portainer/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
	</channel>
</rss>
