Mission goals:
– use a Linux VM in Azure
– install Docker
– connect via SSH
– install and run an open source system called Staytus
It should be straightforward, but this article is meant to record any ‘quirks’ that might occur through this adventure. This is to make it easier for someone else trying to do the same.
Prerequisites:
– Azure user. Create for free => https://azure.microsoft.com/en-us/free/
If you already have a MSDN sub then you should have some credits available. https://azure.microsoft.com/en-us/pricing/member-offers/msdn-benefits-details/
Ok, I will be short and to the point. Less words more action.
and start your Linux VM. Usually, this process is painless, and just works.
The result should look like something like this:
Ok, that means that we have a Docker installation in Ubuntu on Azure with the address docker-ubuntu-4ivk4ppp.cloudapp.net
Updated Mission goals:
– use a Linux VM in Azure – OK
– install Docker – OK
– connect via SSH
– install and run an open source system called Staytus
Next, we need to connect to Ubuntu somehow. If you are running Windows 10 I recommend to try out installing Ubuntu ‘natively’ http://www.windowscentral.com/how-install-bash-shell-command-line-windows-10 because it’s fun 🙂
Or just use your Git Bash: ssh <username>@<ip>
ssh garg@docker-ubuntu-4ivk4ppp.cloudapp.net
and login.
If you get any password problems, try resetting it in Azure:
If you were successfully you should get this:
Hurray. It also shows that the latest Docker is installed.
Updated Mission goals:
– use a Linux VM in Azure – OK
– install Docker – OK
– connect via SSH – OK
– install and run an open source system called Staytus
Next, we are going to install a fork of Staytus => https://github.com/galexrt/staytus
mkdir git
cd git
git clone https://github.com/galexrt/staytus.git
cd staytus
This fork has a docker-compose.yml that split staytus and its database into two containers instead of the original repository running everything in one container (which is not “best practice” for containerization). Let’s start it!
docker-compose up
This command uses the default docker-compose.yml file.
You should start seeing something like this:
Looking at the running containers, it shows that everything is up and should be ready to use:
It also shows that Staytus running on Port 80 on the Ubuntu, but on Port 5000 inside the Container.
Open it!
Get the IP from Azure Portal and open it in a browser:
Great success! Ok, not really. We have to make some endpoints in Azure. The docker-compose file is already forwarding the container port 5000 to the Ubuntu server (Docker Host) on port 80. This means that in order to access the container we need to access the Port 80 on the Ubuntu server.
Here I have added Port 80 and call it “Staytus”.
Let’s check the browser again:
Updated Mission goals:
– use a Linux VM in Azure – OK
– install Docker – OK
– connect via SSH – OK
– install and run an open source system called Staytus – OK
Whoop whoop!
That was pretty cool. In less than 2 hours including creating this article Staytus is now running. I write slow:)