<?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>Container Archives - ServerStadium</title>
	<atom:link href="https://serverstadium.com/knowledge-base/tag/container/feed/" rel="self" type="application/rss+xml" />
	<link>https://serverstadium.com/knowledge-base/tag/container/</link>
	<description>Public Cloud Solution by ServerStadium</description>
	<lastBuildDate>Thu, 27 Apr 2023 09:10:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.5</generator>

<image>
	<url>https://serverstadium.com/wp-content/uploads/2023/04/cropped-favicon-1-32x32.png</url>
	<title>Container Archives - ServerStadium</title>
	<link>https://serverstadium.com/knowledge-base/tag/container/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Host Your Own Docker Hub in ServerStadium</title>
		<link>https://serverstadium.com/knowledge-base/how-to-host-your-own-docker-hub-in-serverstadium/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Thu, 07 Jan 2021 07:03:02 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=617</guid>

					<description><![CDATA[<p>Docker is a popular container application to host an application on a container instead of a server. Docker has a free public registry named Docker Hub that can host custom Docker images. But, there is a condition that a developer does not want his Docker image publicly available. And the Docker Registry exists to meet&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/how-to-host-your-own-docker-hub-in-serverstadium/">How to Host Your Own Docker Hub in ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Docker is a popular container application to host an application on a container instead of a server. Docker has a free public registry named <strong>Docker Hub</strong> that can host custom Docker images.</p>



<p class="wp-block-paragraph">But, there is a condition that a developer does not want his Docker image publicly available. And the <strong>Docker Registry </strong>exists to meet that condition. Docker Registry is an application that manages, stores, and delivers container images in a private environment.</p>



<p class="wp-block-paragraph">Here are the steps to host the Docker Registry environment or hub in ServerStadium using <a href="https://serverstadium.com/knowledge-base/securing-ubuntu-with-ufw/" target="_blank" rel="noreferrer noopener">Ubuntu</a> Virtual Machine.</p>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Prerequisites</h3>



<ul class="wp-block-list">
<li>Two Ubuntu VM&#8217;s acted as private Docker Registry server and the other as a client. In this tutorial, there are 2 VM&#8217;s :<br /><strong>Docker Registry &#8211; 198.167.141.168 &#8211; dockerhub1</strong><br /><strong>Client &#8211; 202.43.249.219 &#8211; dockerhub2</strong></li>
<li>Docker and Docker-Compose installed on both VM&#8217;s.</li>
</ul>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Step 1 &#8211; Installing and Configuring the Docker Registry</h3>



<p class="wp-block-paragraph">To begin with is make a container that contains Docker Registry application running on Docker Registry server with port <strong><span class="has-inline-color has-vivid-cyan-blue-color">5000</span></strong> (this is optional), with the command :</p>



<pre class="wp-block-code"><code># docker run -d -p 5000:5000 --restart=always --name registry registry:2</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" width="639" height="39" class="wp-image-632" src="https://serverstadium.com/wp-content/uploads/2020/12/001.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/001.png 639w, https://serverstadium.com/wp-content/uploads/2020/12/001-300x18.png 300w" sizes="(max-width: 639px) 100vw, 639px" /></figure>



<p class="wp-block-paragraph">Then, pull an image from Docker Hub, for example, like <strong><span class="has-inline-color has-vivid-cyan-blue-color">Alpine</span></strong> image like the below :</p>



<pre class="wp-block-code"><code># docker pull alpine:latest</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" width="332" height="32" class="wp-image-633" src="https://serverstadium.com/wp-content/uploads/2020/12/002.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/002.png 332w, https://serverstadium.com/wp-content/uploads/2020/12/002-300x29.png 300w" sizes="(max-width: 332px) 100vw, 332px" /></figure>



<p class="wp-block-paragraph">If the pulling process is successful you will get output like the below :</p>



<pre class="wp-block-code"><code>REPOSITORY    TAG       IMAGE ID       CREATED         SIZE
alpine        latest    389fef711851   10 days ago     5.58MB</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" width="439" height="80" class="wp-image-651" src="https://serverstadium.com/wp-content/uploads/2020/12/003-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/003-1.png 439w, https://serverstadium.com/wp-content/uploads/2020/12/003-1-300x55.png 300w" sizes="(max-width: 439px) 100vw, 439px" /></figure>



<p class="wp-block-paragraph">Give a new tag into that Alpine image based on Docker Registry location, in this case, is <strong><span class="has-inline-color has-vivid-cyan-blue-color">localhost</span></strong>, with the command :</p>



<pre class="wp-block-code"><code># docker tag alpine:latest localhost:5000/alpine:latest</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-636" src="https://serverstadium.com/wp-content/uploads/2020/12/004.png" alt="" /></figure>



<p class="wp-block-paragraph">If you are running the &#8220;<strong>docker images</strong>&#8221; once again, you will get a result like this :</p>



<pre class="wp-block-code"><code>REPOSITORY    TAG       IMAGE ID       CREATED         SIZE
localhost:5000/alpine   latest    389fef711851   10 days ago     5.58MB</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="509" height="94" class="wp-image-637" src="https://serverstadium.com/wp-content/uploads/2020/12/005.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/005.png 509w, https://serverstadium.com/wp-content/uploads/2020/12/005-300x55.png 300w" sizes="(max-width: 509px) 100vw, 509px" /></figure>



<p class="wp-block-paragraph">After that, push that custom image into Docker Local Registry, with the command :</p>



<pre class="wp-block-code"><code># docker push localhost:5000/alpine:latest</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="433" height="36" class="wp-image-638" src="https://serverstadium.com/wp-content/uploads/2020/12/006.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/006.png 433w, https://serverstadium.com/wp-content/uploads/2020/12/006-300x25.png 300w" sizes="(max-width: 433px) 100vw, 433px" /></figure>



<p class="wp-block-paragraph">If successful, those custom Docker Images will be saved into your own made Docker Registry server.</p>



<pre class="wp-block-code"><code>The push refers to repository [localhost:5000/alpine]
777b2c648970: Pushed 
latest: digest: sha256:074d3636ebda6dd446d0d00304c4454f468237fdacf08fb0eeac90bdbfa1bac7 size: 528</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="687" height="65" class="wp-image-639" src="https://serverstadium.com/wp-content/uploads/2020/12/007.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/007.png 687w, https://serverstadium.com/wp-content/uploads/2020/12/007-300x28.png 300w" sizes="(max-width: 687px) 100vw, 687px" /></figure>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Step 2 &#8211; Pulling Images from the Docker Registry Server</h3>



<p class="wp-block-paragraph">Move the environment into the client VM. And then continues the steps by pulling the custom image from the Docker Registry server, with the command :</p>



<pre class="wp-block-code"><code># docker pull 198.167.141.168:5000/alpine:latest</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="473" height="32" class="wp-image-640" src="https://serverstadium.com/wp-content/uploads/2020/12/008.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/008.png 473w, https://serverstadium.com/wp-content/uploads/2020/12/008-300x20.png 300w" sizes="(max-width: 473px) 100vw, 473px" /></figure>



<p class="wp-block-paragraph">You will be getting an error response like this :</p>



<pre class="wp-block-code"><code>Error response from daemon: Get https://198.167.141.168:5000/v2/: http: server gave HTTP response to HTTPS client</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="797" height="36" class="wp-image-641" src="https://serverstadium.com/wp-content/uploads/2020/12/009.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/009.png 797w, https://serverstadium.com/wp-content/uploads/2020/12/009-300x14.png 300w, https://serverstadium.com/wp-content/uploads/2020/12/009-768x35.png 768w" sizes="(max-width: 797px) 100vw, 797px" /></figure>



<p class="wp-block-paragraph">That error response is caused by Docker default configuration only allowing pull process using a <span class="has-inline-color has-vivid-red-color">secure connection (HTTPS)</span>. Because the Docker Registry service that setup on the Docker Registry server <span class="has-inline-color has-vivid-cyan-blue-color">(VM 198.167.141.168)</span> only uses an <span class="has-inline-color has-vivid-cyan-blue-color">HTTP connection</span>, it will make the pull process into that server fail.</p>



<p class="wp-block-paragraph">So, to do the pull process from the Docker Registry server using an HTTP connection, we have to add the <strong>/etc/docker/daemon.json</strong> file with content like the below :</p>



<pre class="wp-block-code"><code>{
   "insecure-registries" : ["198.167.141.168:5000"]
}</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="352" height="32" class="wp-image-643" src="https://serverstadium.com/wp-content/uploads/2020/12/010.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/010.png 352w, https://serverstadium.com/wp-content/uploads/2020/12/010-300x27.png 300w" sizes="(max-width: 352px) 100vw, 352px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="388" height="97" class="wp-image-644" src="https://serverstadium.com/wp-content/uploads/2020/12/011.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/011.png 388w, https://serverstadium.com/wp-content/uploads/2020/12/011-300x75.png 300w" sizes="(max-width: 388px) 100vw, 388px" /></figure>



<p class="wp-block-paragraph">The IP Address section is from the IP Address of the Docker Registry server. Save that file, and then restart the Docker service with the command :</p>



<pre class="wp-block-code"><code># systemctl restart docker.service</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="370" height="19" class="wp-image-645" src="https://serverstadium.com/wp-content/uploads/2020/12/012.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/012.png 370w, https://serverstadium.com/wp-content/uploads/2020/12/012-300x15.png 300w" sizes="(max-width: 370px) 100vw, 370px" /></figure>



<p class="wp-block-paragraph">After that, try the pull process from the Docker Registry server once again. Since the Docker Registry server IP Address is added into <strong>/etc/docker/daemon.json</strong> to use the pull process using an HTTP connection, the result will be succeeded like below :</p>



<pre class="wp-block-code"><code>REPOSITORY                    TAG       IMAGE ID       CREATED         SIZE
198.167.141.168:5000/alpine   latest    389fef711851   10 days ago     5.58MB</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="566" height="94" class="wp-image-646" src="https://serverstadium.com/wp-content/uploads/2020/12/013.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/013.png 566w, https://serverstadium.com/wp-content/uploads/2020/12/013-300x50.png 300w" sizes="(max-width: 566px) 100vw, 566px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="548" height="64" class="wp-image-650" src="https://serverstadium.com/wp-content/uploads/2020/12/014-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/014-1.png 548w, https://serverstadium.com/wp-content/uploads/2020/12/014-1-300x35.png 300w" sizes="(max-width: 548px) 100vw, 548px" /></figure>



<p class="wp-block-paragraph">As we can see, the Alpine custom Docker Images are displayed on the docker images list on VM Client <span class="has-inline-color has-vivid-cyan-blue-color">(VM 202.43.249.219),</span> indicating the custom image is successfully pulled from our Docker Registry server.</p>



<p class="wp-block-paragraph">In the future, this Docker Registry server can store and deliver another custom Docker image for multiple application development.</p>



<p class="wp-block-paragraph">Congratulations! You have configured your own Docker Hub (Docker Registry) on ServerStadium Virtual Machine.</p>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Conclusion</h3>



<p class="wp-block-paragraph">In this guideline, we have installed and configured our own Docker Hub (Docker Registry) on the Virtual Machine ServerStadium environment for serving custom images and containers using Docker Registry as storage and delivering tools to provide custom containers in the application development.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/how-to-host-your-own-docker-hub-in-serverstadium/">How to Host Your Own Docker Hub in ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Deploy Container in ServerStadium using Docker</title>
		<link>https://serverstadium.com/knowledge-base/how-to-deploy-container-in-serverstadium-using-docker/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Mon, 04 Jan 2021 20:41:24 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=621</guid>

					<description><![CDATA[<p>This article will explain how to deploy containers in ServerStadium using Docker. Before knowing how to deploy containers using docker, let&#8217;s understand the basic of it. What is Docker? Docker is a tool that allows developers, sys-admins, etc. to easily deploy their applications in a sandbox (called containers) to run on the host operating system, e.g.&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/how-to-deploy-container-in-serverstadium-using-docker/">How to Deploy Container in ServerStadium using Docker</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">This article will explain how to deploy containers in ServerStadium using Docker. Before knowing how to deploy containers using docker, let&#8217;s understand the basic of it.</p>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">What is Docker?</h3>



<p class="wp-block-paragraph">Docker is a tool that allows developers, sys-admins, etc. to easily deploy their applications in a sandbox (called <em>containers</em>) to run on the host operating system, e.g. Linux.</p>



<p class="wp-block-paragraph">Accordingly, the key benefit of Docker is that it allows users to <strong>package an application with all of its dependencies into a standardized unit</strong> for software development. Unlike virtual machines, containers do not have high overhead, enabling more efficient usage of the underlying system and resources.</p>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">What are containers?</h3>



<p class="wp-block-paragraph">To begin with, the industry standard today is to use Virtual Machines (VMs) to run software applications. VMs run applications inside a guest Operating System, which runs on virtual hardware powered by the server’s host OS.</p>



<p class="wp-block-paragraph">In addition, VMs are great at providing full process isolation for applications. There are very few ways a problem in the host operating system can affect the software running in the guest operating system and vice-versa. But this isolation comes at a great cost — the computational overhead spent virtualizing hardware for a guest OS to use is substantial.</p>



<p class="wp-block-paragraph">Furthermore, containers take a different approach. By leveraging the low-level mechanics of the host operating system, containers provide most of the isolation of virtual machines at a fraction of the computing power.</p>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Prerequisites</strong></h3>



<p class="wp-block-paragraph">Before we begin the tutorial, the following are the stack versions that we are going to install:</p>



<ul class="wp-block-list">
<li>OS: Ubuntu 18.04 (LTS)</li>
<li>Latest Docker Engine stable version for Ubuntu 18.04</li>
<li>Latest Docker Repository</li>
</ul>



<p class="wp-block-paragraph">In short, there are three tasks that we need to do:</p>



<ul class="wp-block-list">
<li>Open the necessary port on ServerStadium Security Profile</li>
<li>Install docker (Community Edition)</li>
<li>Deploy or Create a Web Server container with Nginx</li>
</ul>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Open Necessary Port on ServerStadium frontend</h3>



<p class="wp-block-paragraph">Before we start further, open the necessary ports to your instances, go to <a href="https://cp.serverstadium.com/" target="_blank" rel="noreferrer noopener">https://cp.serverstadium.com/</a> &gt;&gt; Home &gt;&gt; networking &gt;&gt; Security Profile</p>



<p class="wp-block-paragraph">There are at least three ports that need to be opened 80, 443 (for HTTP and HTTPS), and 22 (for SSH)</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-809" src="https://serverstadium.com/wp-content/uploads/2021/01/image-36.png" alt="" width="575" height="223" /></figure>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Install Docker</h3>



<p class="wp-block-paragraph">Please run the following command to ensure there is no old docker installed:</p>



<p class="wp-block-paragraph">$ <code>sudo apt-get remove docker docker-engine docker.io containerd runc</code></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="671" height="215" class="wp-image-658" src="https://serverstadium.com/wp-content/uploads/2020/12/image.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/image.png 671w, https://serverstadium.com/wp-content/uploads/2020/12/image-300x96.png 300w" sizes="(max-width: 671px) 100vw, 671px" /></figure>



<p class="wp-block-paragraph">Additionally, it’s OK if <code>apt-get</code> reports that none of these packages are installed.</p>



<p class="wp-block-paragraph"><strong>Install using the repository</strong></p>



<p class="wp-block-paragraph">Before installing Docker Engine for the first time on a new host machine, you must set up the Docker repository. Afterward, you can install and update Docker from the repository.</p>



<p class="wp-block-paragraph">Setup The Repository</p>



<pre class="wp-block-preformatted"><code>$ sudo apt-get update</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="689" height="131" class="wp-image-660" src="https://serverstadium.com/wp-content/uploads/2020/12/image-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/image-1.png 689w, https://serverstadium.com/wp-content/uploads/2020/12/image-1-300x57.png 300w" sizes="(max-width: 689px) 100vw, 689px" /></figure>



<pre class="wp-block-preformatted"><code>$ sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common</code></pre>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-661" src="https://serverstadium.com/wp-content/uploads/2020/12/image-2.png" alt="" width="800" height="262" srcset="https://serverstadium.com/wp-content/uploads/2020/12/image-2.png 897w, https://serverstadium.com/wp-content/uploads/2020/12/image-2-300x99.png 300w, https://serverstadium.com/wp-content/uploads/2020/12/image-2-768x253.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></figure>



<p class="wp-block-paragraph">There will appear a confirmation prompt; please type &#8220;Y&#8221; to continue</p>



<p class="wp-block-paragraph">Add Docker’s official GPG key:</p>



<pre class="wp-block-preformatted"><code>$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="743" height="55" class="wp-image-662" src="https://serverstadium.com/wp-content/uploads/2020/12/image-3.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/image-3.png 743w, https://serverstadium.com/wp-content/uploads/2020/12/image-3-300x22.png 300w" sizes="(max-width: 743px) 100vw, 743px" /></figure>



<p class="wp-block-paragraph">To set up the <strong>stable</strong> repository:</p>



<pre class="wp-block-preformatted"><code>$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"</code></pre>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-663" src="https://serverstadium.com/wp-content/uploads/2020/12/image-4.png" alt="" width="750" height="123" srcset="https://serverstadium.com/wp-content/uploads/2020/12/image-4.png 955w, https://serverstadium.com/wp-content/uploads/2020/12/image-4-300x50.png 300w, https://serverstadium.com/wp-content/uploads/2020/12/image-4-768x127.png 768w" sizes="(max-width: 750px) 100vw, 750px" /></figure>



<p class="wp-block-paragraph"><strong>Install Docker Engine</strong></p>



<p class="wp-block-paragraph">To install the Docker Engine command, run:</p>



<pre class="wp-block-preformatted"><code>$ sudo apt-get install docker-ce docker-ce-cli containerd.io</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="588" height="305" class="wp-image-664" src="https://serverstadium.com/wp-content/uploads/2020/12/image-5.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/image-5.png 588w, https://serverstadium.com/wp-content/uploads/2020/12/image-5-300x156.png 300w" sizes="(max-width: 588px) 100vw, 588px" /></figure>



<p class="wp-block-paragraph">Verify that Docker Engine is installed correctly by running the <code>hello-world</code> image.</p>



<pre class="wp-block-preformatted"><code>$ sudo docker run hello-world</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="630" height="440" class="wp-image-665" src="https://serverstadium.com/wp-content/uploads/2020/12/image-6.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/12/image-6.png 630w, https://serverstadium.com/wp-content/uploads/2020/12/image-6-300x210.png 300w" sizes="(max-width: 630px) 100vw, 630px" /></figure>



<p class="wp-block-paragraph">There will be information that states as follows after verification is running properly:</p>



<pre class="wp-block-preformatted">Hello from Docker!
This message shows that your installation appears to be working correctly.</pre>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Deploy or Create a Web Server container with Nginx</h3>



<p class="wp-block-paragraph">Now, we have to create a simple hosting static content command.</p>



<p class="wp-block-paragraph">Create a folder</p>



<pre class="wp-block-preformatted">mkdir -p <code>/var/www/html</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="377" height="49" class="wp-image-807" src="https://serverstadium.com/wp-content/uploads/2021/01/image-34.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-34.png 377w, https://serverstadium.com/wp-content/uploads/2021/01/image-34-300x39.png 300w" sizes="(max-width: 377px) 100vw, 377px" /></figure>



<p class="wp-block-paragraph">Download, deploy the latest nginx image, and configure the web-root. We named it &#8220;test-nginx&#8221;</p>



<pre class="wp-block-preformatted"><code>docker run --name test-nginx -v /var/www/html:/usr/share/nginx/html:ro -d nginx</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="855" height="191" class="wp-image-810" src="https://serverstadium.com/wp-content/uploads/2021/01/image-37.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-37.png 855w, https://serverstadium.com/wp-content/uploads/2021/01/image-37-300x67.png 300w, https://serverstadium.com/wp-content/uploads/2021/01/image-37-768x172.png 768w" sizes="(max-width: 855px) 100vw, 855px" /></figure>



<p class="wp-block-paragraph">After that, verify if the container is running:</p>



<pre class="wp-block-preformatted">docker container ls</pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="812" height="66" class="wp-image-813" src="https://serverstadium.com/wp-content/uploads/2021/01/image-39.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-39.png 812w, https://serverstadium.com/wp-content/uploads/2021/01/image-39-300x24.png 300w, https://serverstadium.com/wp-content/uploads/2021/01/image-39-768x62.png 768w" sizes="(max-width: 812px) 100vw, 812px" /></figure>



<p class="wp-block-paragraph">Verify whether port 80 it&#8217;s listening not by running the following command:</p>



<pre class="wp-block-preformatted">netstat -tulpn | grep 80</pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="718" height="58" class="wp-image-811" src="https://serverstadium.com/wp-content/uploads/2021/01/image-38.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-38.png 718w, https://serverstadium.com/wp-content/uploads/2021/01/image-38-300x24.png 300w" sizes="(max-width: 718px) 100vw, 718px" /></figure>



<p class="wp-block-paragraph">Then, create a test script:</p>



<pre class="wp-block-preformatted">nano /var/www/html/index.html</pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="469" height="32" class="wp-image-814" src="https://serverstadium.com/wp-content/uploads/2021/01/image-40.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-40.png 469w, https://serverstadium.com/wp-content/uploads/2021/01/image-40-300x20.png 300w" sizes="(max-width: 469px) 100vw, 469px" /></figure>



<p class="wp-block-paragraph">Append the following test script:</p>



<pre class="wp-block-preformatted">TEST WEBSERVER as CONTANIER</pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="295" height="56" class="wp-image-815" src="https://serverstadium.com/wp-content/uploads/2021/01/image-41.png" alt="" /></figure>



<p class="wp-block-paragraph">When it&#8217;s done. Save the modification by pressing &#8220;<strong>ctrl + x</strong>&#8220;, Choose &#8220;<strong>Y</strong>&#8221; then press &#8220;<strong>Enter</strong>&#8220;</p>



<p class="wp-block-paragraph">Please open a browser app such as Chrome, or Firefox and insert your Public IP instance: http://202.43.249.138/ and it will show the following display:</p>



<pre class="wp-block-preformatted">TEST WEBSERVER as CONTANIER</pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="415" height="118" class="wp-image-816" src="https://serverstadium.com/wp-content/uploads/2021/01/image-42.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-42.png 415w, https://serverstadium.com/wp-content/uploads/2021/01/image-42-300x85.png 300w" sizes="(max-width: 415px) 100vw, 415px" /></figure>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Docker CheatSheet:</h3>



<p class="wp-block-paragraph"><strong>list all Docker containers</strong></p>



<pre class="wp-block-preformatted"><code>docker container ls -a</code></pre>



<p class="wp-block-paragraph"><strong>Stop a specific container</strong></p>



<pre class="wp-block-preformatted"><code>docker container stop [container_id]</code></pre>



<p class="wp-block-paragraph"><strong>Remove a stopped container</strong></p>



<pre class="wp-block-preformatted"><code>docker container rm [container_id]</code></pre>



<p class="wp-block-paragraph"><strong>Remove all stopped containers:</strong></p>



<pre class="wp-block-preformatted"><code>docker container rm $(docker container ls –aq)</code></pre>



<p class="wp-block-paragraph"><strong>List Docker image</strong></p>



<pre class="wp-block-preformatted"><code>docker image ls</code></pre>



<p class="wp-block-paragraph"><strong>Remove an image, or multiple images:</strong></p>



<pre class="wp-block-preformatted"><code>docker image rm [image_id1]</code></pre>



<pre class="wp-block-preformatted"><code>docker image rm [image_id1] [image_id2]</code></pre>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Conclusion</h3>



<p class="wp-block-paragraph">To sum up, this article explains running NGINX official image, adding our custom HTML files, and creating a container based on the official image</p>



<p class="wp-block-paragraph">Last but not least, we hope this helps you. Thank you.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/how-to-deploy-container-in-serverstadium-using-docker/">How to Deploy Container in ServerStadium using Docker</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
