The Insiders Guide to Docker Serverless

Learn about Docker serverless, a powerful combination of containerization and serverless architecture. Discover the benefits, tools, and steps to get started with deploying serverless functions in Docker containers.

The Insiders Guide to Docker Serverless

The word Serverless plants a seed in our minds without us knowing what it actually is. Are you visualizing empty data centers?

Does Serverless mean we are abstracting servers from our infrastructure? Of course not. So, what is Serverless, and what benefit does it provide?

Before answering the Serverless question, we need to understand what started the Serverless trend. Amazon announced its Lambda service back in November 2014, which ignited the Serverless buzz.

AWS's Lambdathat Serverless has started gaining momentum within the last six months is a Functions as a Service (FaaS) or snippets of code designed to run a specific task.

Serverless/FaaS stands out from other solutions because it uses functions. These functions are triggered by a defined event. Once the Function has run, it terminates, waiting for the next event to arrive and start again.

Serverless applications run only when requested, unlike traditional VMs/Containers, which always run. Wow! Serverless has enormous potential to reduce cloud computing costs.

The Google Trend graph indicates that Serverless has started gaining momentum within the last six months. The Serverless trend is still new and on the upswing of the growth curve.

The big players such as Microsoft announced Azure Functions in the summer of 2016. GCE Functions was recently released in Alpha. The already mature AWS Lambda has jumped ahead in the Serverless race.

Open Source alternatives like IronFunctions and Funker are making incredible advancements. The Open Source projects are trying to abstract the AWS Lambda idea away from vendor lock-in. This will allow us to run FaaS on Docker and any infrastructure we desire. More choices, flexibility, and control. Win/Win.

Serverless Google Trend
Serverless Trend

Docker and Serverless

I discovered Serverless through Docker's Ben Firshman. He presented a Serverless Demo at DockerCon 2016. Ben's demo blew me away, and I scrambled to understand the Serverless concept with a sense of urgency. I tried his demo and started researching Serverless and its concepts.

Combining Serverless with Docker is equivalent to discovering fire for the first time. This combination unearths massive potential.

Ben Firshman pointed out

"some people suggest that Serverless will replace Docker. That's not entirely accurate as Docker is the perfect platform to build Serverless applications."

Now is the time for the fine print disclaimer. Docker and Serverless don't run right out of the box. It requires a bit of elbow grease, coffee, and a framework. The Serverless Resource section contains some frameworks available for Docker and additional documentation. The foundation of these frameworks is Docker and Docker Swarm.

Docker == Serverless, and that is plain Awesome Sauce!

Awesome Sauce

It Doesn't Fix Everything (Yet)

Docker and Serverless are sailing into uncharted waters. Some functionality is just not yet available or mature.

For example, the speed at which containers and Functions execute could be a bottleneck. Deploying stacks of containers and Functions is also another consideration. Finally, the operational side, such as logging and monitoring, needs to ramp up to support the Serverless approach and understand this new operating model.

None of these points mentioned should be a showstopper. With proper planning and preparation, nothing should catch you off guard. Your particular use case will drive what is feasible and not.

Serverless Resources

I recommend the best Serverless reference on the internet: Serverless Architectures. The article authors, Martin Fowler and Mike Roberts covered all the aspects of Serverless. This is the best Serverless information on the internet and should be a guide for everyone.

Here are some of the Docker Serverless projects and resources currently available. Please note that most of these projects are less than 6 months old. Ensure your coffee machine is operating at 100% as we will need a constant caffeine flow for the next few weeks.

Serverless Resources

Serverless Projects

  • IronFunctions - The serverless microservices platform powered by Docker
  • Docker Lambda - Docker images and test runners that replicate the live AWS Lambda environment
  • Docker faas - Docker Functions as a Service provisioned with one command onto a Docker Swarm
  • Serverless Docker Voting App - This is the famous real-time voting app that Bret Fisher demoed in the above video.
  • Funker - Functions as Docker containers by Docker's Bret Fisher
  • go-dexec - Go Library to run processes inside Docker containers as if you are running them locally

FAQ Section: The Insider's Guide to Docker Serverless

What does "Docker serverless" mean, and how does it differ from traditional serverless computing?
"Docker serverless" refers to using Docker containers in a serverless architecture, where the infrastructure automatically scales based on demand without the need for manual management of servers. Unlike traditional serverless computing, which often relies on managed services like AWS Lambda, Docker serverless allows you to package and deploy your serverless functions within Docker containers, giving you more control over the environment and dependencies.

How can Docker and serverless architecture work together?
Docker and serverless architecture can work together by using containers to package and deploy serverless functions. This combination allows you to standardize your environment across different serverless platforms or on-premises infrastructure. Docker enables consistent deployment, version control, and isolation of serverless functions, making it easier to manage complex applications across multiple environments.

What are the benefits of using Docker in a serverless architecture?
Using Docker in a serverless architecture offers several benefits, including greater control over the runtime environment, easier management of dependencies, and the ability to run serverless functions across different cloud providers or on-premises systems. Docker also simplifies the process of testing and debugging serverless functions by allowing you to replicate the production environment locally.

What tools and frameworks support Docker serverless deployments?
Several tools and frameworks support Docker serverless deployments, including the Serverless Framework, OpenFaaS, and AWS Lambda with custom runtimes. These tools allow you to package your serverless functions in Docker containers and deploy them to various platforms, enabling you to leverage the benefits of serverless computing while maintaining the flexibility and control offered by Docker.

How do I get started with Docker serverless?
To get started with Docker serverless, first choose a tool or framework that supports Docker-based serverless deployments, such as the Serverless Framework or OpenFaaS. Then, create your serverless function, package it in a Docker container, and deploy it using the chosen tool. You can use Docker Compose for local testing and debugging, and once everything is working correctly, deploy your function to the desired cloud provider or serverless platform.

Follow me

If you liked this article, Follow Me on Twitter to stay updated!