A Docker analogy

Imagine you have an USB pendrive and you install on it an Operating System, a Web server, a database and you create a web page on top of that. You are able to boot into your pendrive and everything is peachy. You can access your website that is being served by your laptop through the web server installed on your pendrive.

Now imagine you want to take that same setup to your desktop because you think it’s more appropiate to have a web server on a less portable computer. You extract the pendrive and you plug it in your desktop and boot. Again everything is peachy. Now your website is reachable at your desktop.

Now imagine again you would prefer Amazon to host your website and leverage an environment that you know as a fact works. You go to your closest AWS datacenter and you ask the guy over there: “Hey dude, can I plug this USB pendrive in one of your servers and boot it up from there?”. The guy says NO.

Well Docker is your USB pendrive. And with Docker the guy says YES. And you don’t have to drive to your closest AWS datacenter. And AWS doesn’t have to be AWS. It can be Digital Ocean or any other VPS or Dedicated server that supports Docker.

13 Likes

Well that is the docker perfect explanation I’ve ever heard! Wel done Jon!

Maybe you should consider writing some getting started with Docker articles on Medium.

3 Likes

Explanations like this are very helpful :slight_smile:

2 Likes

I’m not yet clear of the benefits of using Docker, but this was certainly helpful. I installed Docker Desktop and tried it out with Wappler and all went well - but I haven’t experimented since as there was no obvious reason not to continue my current WAMP setup etc, at least not for the moment. I need to spend time understanding it better.

I was wondering about the other way round - using a web application, optionally on a laptop/desktop. Using your example, would you still need the pendrive, or would it still be the easier option, for your laptop and desktop computers? Or would Docker do the job there too?

Eg I can use an installation program to create an installer for Windows or Mac. A customer receives it, double-clicks it, and after a few moments they can double-click a new icon on their desktop and run the application. Could Docker do all this, with a Wappler-created application? I suppose they would have to install Docker Desktop separately (or perhaps that could be incorporated into an installer). Or would this be an unusual way to use Docker?

You need docker desktop(engine) in order to run docker apps in your device.

Docker engine sets the ground rules for any type of device to be able to run docker apps.

Docker desktop is just a fancy name that is given to a docker engine native installation for windows/mac computers.

It is the docker engine the one that acts as middleware and translates everything so that the host(your laptop, a macbook, an AWS server, a windows server, a raspberry pi, etc) is able to run docker apps.

1 Like

Thanks Jon. I thought that was the case - that you needed Docker Desktop/Engine. It’s helpful to have the terminology clarified.

Do you know if Docker Desktop is generally used as a method of running desktop applications (standalone or networked), or is it more for development purposes - where the final destination for the application will be for the web/ cloud server etc.?

Imagine you developed your app with:
Windows 10
Apache 2.2
Mysql 5.5
PHP 5.3

While developing you made use of some specific Apache modules and some PHP functions that only work with your PHP version.

You find a hosting company like bluehost with their cpanel and all that. Your app works perfect until they decide to disable an Apache module because it’s being exploited by one of the customers and they also upgrade PHP to patch a security risk. Overnight your web app stops working and it won’t work anymore because the hosting company will not enable that Apache module ever again.

You have to go back to your WAMP local environment and disable the Apache module and update your PHP version to see how you can work around them to keep using your hosting provider.

With docker you can be sure that what works on your computer will always work on the remote host, because you are in charge of Apache, PHP and mysql.

Couldn’t you bypass docker and install apache, php and mysql directly on the remote server? Yes of course. But it’s a pain in the ass :slight_smile: Docker packages everything for you in a easy way and provides additional goodies.

With Docker you get simplicity and consistency.

You can dockerize a desktop application. Is it common? No. And there is not much literature about it on the internet.

3 Likes

I’ve certainly been in that situation. My hosting company is very helpful and usually a resolution is found pretty quickly. But it’s a good point - and is potentially more of an issue where a website becomes more of an application, perhaps without any public access.

I suppose a concern I would have is that the hosting company may make such changes for good reason - reasons I, with much less expertise in running servers, might not be aware of. Lots of interesting ideas…

1 Like

It all falls down to having options :slight_smile:
Docker is just one additional tool in your toolbox.

1 Like

I agree that docker is a great piece of engineering. I think it is important though to put things in context. We have a lot of small developers and hobbyists using wappler who need to understand it is just another tool. Generally docker is only available on dedicated or VPS setups and I suspect that a big percentage of users are using platforms like godaddy to keep costs down. For those, docker deployment is an expensive luxury.
Docker desktop is a great tool for small developers and hobbyists as it saves the need for LAMP/WAMP/MAMP servers at local level but moving to docker enabled deployment servers can be a costly move.
So yes, docker is a great tool but like everything, convenience comes with a price tag

3 Likes

For those of you who already made the move to docker :
Do we need to deploy to a live docker env too if our local dev env is in docker ?
Or we can still deploy through FTP if our host doesn’t support docker yet ?
Many thanks ! :slight_smile:

@Hyperbytes docker doesn’t necessarily mean highly priced hosting.
Digital Ocean offers really affordable hosting plans, starting at $5/month and it’s really easy to setup/get started with them.
For $10/month you get 2 GB Ram / 1 vCPU / 2 TB traffic / 50 GB SSD - which is more than enough for most of the people here :slight_smile:

2 Likes

Simple answer Jeff, yes and yes

1 Like

I have to disagree here. I don’t know about FTP but you can deploy via GIT without needing a docker engine in your remote host.

And if you setup a remote target for FTP I am assuming this is also possible? Not to speak that you could actually use a third-party app to deploy via FTP.

Do note that docker is specially great for local development.

You might have running WAMP/MAMP already running but many new users don’t, and also running different configurations and different virtual hosts locally is always a pain to setup.

If you are locally on Windows and have WAMP running and your hosting is on Linux there are great differences… what runs on Windows might not run on Linux… like Linux file system is case sensitive and Windows not …

With docker setting up is just point and click! There you don’t have to have anything else installed locally to get your local web development configuration ready, but just docker desktop!

It installs directly a Linux virtual machine with all the real configuration you need, on the platform you will be running your live site - Linux - even if your development machine is on Windows.

With docker you have ready to go installations (images) of all web/databases servers that you’ll ever need - at your finger tips.

No more “it runs on my system, but live it doesn’t” problems! And no more cumbersome local services installation and loosing hours just to setup your development machine.

You just need Wappler + Docker Desktop and are ready to develop!

And for publishing your website, well you can still use the regular ftp publishing and deploy to any host, or go for cloud deploy with docker where you publish your site with exact the same configuration as your local development.

4 Likes

@JonL, that’s a great analogy.

Not to muddy the waters a whole lot, but Docker is not meant to hold everything in one container. Containerization is really meant to help with microservices and scalability. In other words, the ability to separate your app into more logical functions (e.g. web server, app server, database as a simple example without getting into microservices).

With containerization and orchestration (Swarm or Kubernetes) you can scale horizontally and do other devops functions.

More to chew on here:


https://thornelabs.net/posts/deploy-a-three-tier-web-application-to-kubernetes.html

4 Likes

Well said Hyperbytes. It is my case: I build small websites and I run them on my resseller account/Shared hosting. (Canadian host - a great company, but they don’t actually offer Docker).

So while I do now better understand the Docker tehcnology by reading about it on the web and this forum, indeed like Hyperbytes say there are probably many Wappler users who will not use that thechnology either because of the cost or the extra level of complexity or they simply don’t need it because as kfawcett mentionned Docker is to be used for some specific situations and is not so recommended for all types projects.

I did build a big site a few years ago that would benefit from usingDocker, but other than that I build some websites that are a mix of statics and dynimic, mostly running some kind of catalogues. But my goal is that I could eventually take more advanced projects with the help of Wappler so Docker might be interesting.

Anyway I understand it is a great tool and I continue learning about it and will see how I can make use of it in the future :slight_smile:

Yes @Webjack357 , Unless i misunderstand the website Digital Ocean’s minimum package is $5 but there appears there is also $15 to add for their minimum database package so that is $240 per year (plus taxes) (£186 GBP+tax). That’s big money when you have around 100 sites hosted with you, way more than I currently pay.

Those are Managed Databases(A premium addon). You can install whatever database you want and use it in the normal package without paying a premium.

1 Like

How many users on this forum for example ex bubblers who have never even managed a database will want to have to start self installing databases ?

1 Like