In light of the recent COVID-19 pandemic - OPTASY would like to offer DRUPAL website support for any Health Care, Government, Education and Non-Profit Organization(s) with critical crisis communication websites or organizations directly providing relief. Stay Safe and Stay Well.

Should I Use Docker in Production Environment? Is It Safe? 

Should I Use Docker in Production Environment? Is It Safe? 

by RADU SIMILEANU on Aug 31 2018

“Should I use Docker in production?” 

Are you "torn” between:

Docker's superpower as a container platform and all the security concerns related to the Docker model?

“Seduced” by the names of all those giant companies — Twitter, Google, Amazon, eBay, Netflix —  who're already using Docker containers in production? Yet, still skeptical and hesitant to run them in production environment considering all the signaled data management issues?                    

Now, instead of letting this question turn into a “haunting” dilemma, you'd better dug for some answers. Find out:

 

  • whether Docker is right for your own unique project, as well
  • how a container infrastructure works (compared to a traditional environment) 
  • what it takes to use Docker in production
  • which are the common misconceptions and issues with Docker in production

     

And, most of all: based on your own use case, should you be running Docker in production environment or not?

 

1. The One Question to Ask Yourself: “What Will I Do with Docker in Production?”

Before asking yourself:

 “Should I be using Docker in production? How safe is it?”

… you'd better answer one critical question:

“What will I do with Docker in production?”

And toying with the thought of using Docker containers does require a reevaluation of your system's whole infrastructure. From the ground up:

 

  • How will you monitor Docker containers in production?
  • How will things be deployed?
  • How will backups be performed?
  • What about updates? How will they be handled?

     

Also, while giving yourself some realistic and straightforward answers to all these questions, try to consider different attack vectors, as well:

 

  • What services will your Docker containers get access to?
  • Are you able to restrict their access to the host system?
  • And what kind of “privileges” will they get?

     

  

So many things to clarify before you can ask yourself:

“Should I use Docker in production?” 

 

2. Container Infrastructure vs Traditional Environments

How does a Docker container infrastructure work?

It's critical that you fully understand what sets it apart from a traditional environment before you can assess whether it's safe for production usage in your project or not.

Unlike traditional environments, where a sysadmin would normally run upgrades and restart services, in container infrastructures, containers are read-only, immutable... elements.

In other words: security upgrades won't happen inside your Docker containers; for these upgrades to run, you'll need to redeploy newly upgraded versions of your containers.

Note: since developers can push containers to your platform, you should define and enforce custom policies to limit the no. of privileges assigned to each one of the containers in your infrastructure.

 

3. 2 Most Common Misconceptions about Using Docker in Production

Since it hit the systems scene (2002) and quickly “stole the show”, Docker's generated a lot of misconceptions. And probably the most common one (that all the other ones stem from) is that:

"Docker's ridiculously easy to use; it's a “one size fits all projects/use cases/infrastructures...” type of technology."

Well, not quite...

Now, let's “bust some Docker-related myths” once and for all:

 

3.1. Running Docker in Multi-Host Production Environments Is (So) Simple

It's almost grown into a universal truth that:

Using Docker even in a multi-host production environment is... nothing but a child's play.

It is technically possible, indeed, yet, it's far from simple!

Before running Docker in a multi-host network —  in a robust and safe way, I mean —  you need to consider and to put in place the proper management of a whole lot of variables:

 

  • orchestrating container deploys with no downtime at all
  • managing container logs
  • ensuring that the private image repository's 100% secure
  • managing container logs
  • properly handling all container deploy roll-backs

     

And the list is almost a never-ending one...

See? Sure, big companies manage to use Docker in multi-host production environments and to successfully handle all the above variables, yet the process's anything but trivial.

 

3.2. It's OK to Blindly Jump into Docker, No Matter The Infrastructure

Tempted to go from “Should I use Docker in production?” to “I should/can definitely use it straight away!”?

And this is yet another misconception that has grown out of the general idea that using Docker requires zero preparations; zero planning and evaluation of your current infrastructure.

That it's conveniently easy to use and it fits all use cases.

Wrong! 

You need to take a whole lot of aspects into account before using Docker in production:

It requires a robust, stable foundation/infrastructure!

In other words, if your current system does not have:

 

  • an automated system setup 
  • a fully secured least-privilege type of access
  • automated deploys
  • easy-to-be-restored and 100% secure database backups
  • and more

     

... you should reconsider using Docker in production ASAP. Or at least postpone your plan till you've filled in all those cracks in your systems' infrastructure...

 

4. Choosing the Right Path From Test Environment to Production Environment

The very first step to take for “leveling up” from running Docker in your test environment to using it in production is: choosing the right path.

This can be either:

 

  • predetermined by your own project's particularities (project-specific constraints such as a specific cloud service or datacenter) 
  • DIY
  • a rented cloud service
  • a pre-made platform

     

Choose your path wisely!

 

5. 3 Key Aspects to Take into Account For a Smooth Production Usage of Docker

 

5.1. The Docker Engine: Tweaking Its Default Settings Is a Must

As I've been trying to stress out here:

Running Docker in production does require certain preparations and considerations.

For instance, once you install the Docker engine to your distribution of choice (Ubuntu or Red Hat or... another one), you shouldn't stick to its default settings.

They're not suitable for production usage!

Therefore, it will require some tweaking so that your Docker engine can handle the load once in production environment.

Moreover, your engine will be in charge of running the containers and nothing more. When it comes to:

 

  • cleaning up containers
  • … volumes
  • … logs

     

these are all your configuration's responsibility.

And 2 more words of caution/pieces of advice:

 

  • keep in mind to check the graph driver (go for Overlay2 if it's the latest version of kernel that you're using)
  • keep both your Docker engine and the kernel safely up-to-date 

     

5.2. A Well-Built CI/CD Pipeline Can Save Your Life

And it's just partly an exaggeration...

For once you run your Docker containers in production and you need to handle a complex infrastructure of services, having a reliable pipeline in place can do wonders.

In short: if you don't automate the process of moving your containers across all the 3 stages of production — build phase, test phase, deployment phase — you'll go nuts...

Tip: remember to script everything; also, to version control each and every script and configuration.

 

5.3. Security: Handle It Properly, Right from the Testing Environment

In other words: no matter how tempted you might be to overlook this aspect once you finally have Docker running properly in production, don't underrate the security issue.

Moreover, you should give it due consideration right from the testing environment...

Once you deploy your Docker containers in production environment, be 101% cautious and vigilant to detect any network vulnerabilities threatening your data.

 

6. “Should I Use Docker in Production?” Is It Safe? Is It Efficient?

Back to our initial question:

“Is it safe to run Docker in production environment?”

My answer to you is:

It is, as long as you take into account all the above-mentioned technical aspects and variables and as long as you adopt the best practices for using Docker in production.

Meaning:

 

  • applying updates
  • running your CI tests
  • automating... everything
  • closely monitoring your Docker containers once in production
  • using the available tools
  • running only current versions
  • running only one process per container 
  • “supercharging” your orchestration tool with all the appropriate security measures (Kubernetes, Swarm, Titus, DCOS etc.) 
  • etc.

     

In short: Docker is only as safe as its users' implemented safety measures.

Technically, it can be used in production. 

When it comes to safety, Docker's come a (really) long way since its early days. 

With:

 

... Docker's once glaring security flaws (e.g. less isolation of containers as compared to virtual machines) now seem like a bad memory from its old “experimenty” stage.

Yet, to your “Should I use Docker in production?” type of question I can only answer:

“You should, if you don't do it blindly and you commit yourself to following the best practices”

 

7. In Conclusion...

If I was to sum up, into a “shortlist of commandments”, all the recommendations, words of caution, clarifications, and explanations here-above, it would go something like this:

 

  1. don't jump blindly into Docker; take your time to think through all the involved aspects
  2. keep in mind that it's far more unlikely for an attacker to exploit an insecure Docker container in your system than to... tap into social engineering for getting his hands on the password
  3. Docker's an extremely powerful tool, so running it on top of an unstable infrastructure is pretty much like driving a sports car on a pothole-riddled road
Development

We do Web development

Go to our Web development page!

Visit page!

Recommended Stories

Magento vs Shopify 2020: Which Platform Should You Use for Your eCommerce Store? And Why?
A bit stuck? Are you looking to roll out your online store, but… you’re struggling with a Magento vs Shopify 2020 dilemma? Which solution works best for the size and the type of your eCommerce business? Which one covers most of your feature needs? In today’s post you’ll get your answers to the following questions: How are they different? Why would you choose Shopify over Magento? What are its strongest selling points? What are the cons of Shopify? What are the pros and cons of Magento vs Shopify? Which eCommerce platform works best for your type of business? 1. What Are the Major Differences Between Magento and Shopify? The main reason why you’re torn between Magento and Shopify is that: You don’t have a clear picture of the essential differences between them. So, let me expose them to you: 1.1. Magento is an eCommerce solution for enterprise-level online stores. It’s robust and flexible enough to power fully customized eCommerce websites, built from scratch — that you can further expand to fit your growth plan — by teams of Magento developers. 1.2. Shopify, on the other hand, is self-managed.  You don’t need any specialized skills — or server-side techs — to set up a Shopify store.  A front-end developer and a designer, at most, will do. “How easy is it to use Shopify?” Shopify is best-known for being beginner-friendly.  In short, the “Magento vs Shopify” dilemma comes down to: Flexibility and customization vs Ease of use. Which one's more important to you? 2. Magento vs Shopify 2020: Why Would You Choose Shopify? What makes Shopify a candidate for the title of “the best solution for creating an eCommerce website in 2020"? Here’s why Shopify could be the better choice for your online store: you have no (or limited) coding skills the idea of having a huge app marketplace at your disposal to browse through sounds tempting to you you need to get your e-Store up and running… now: the drag-and-drop website builder allows you to set up a new store in… minutes it’s an end-to-end eCommerce solution that you’re looking for, one that enables you to roll out and manage your online store with no technical experience it’s easier to use: its interface is famous for being particularly user-friendly you run a small or medium-sized eCommerce business page loading time is critical for you: Shopify’s just… fast Overall, it’s much less of a headache than Magento and usually the go-to option for small eCommerce business owners, with no web development experience, who need to get their websites rolled out fast. 3. What Are the Cons of Shopify? What could make you hesitate to choose Shopify for your eCommerce website? For there are, indeed, some limitations to consider before going for this particular platform:   You’d be trading some of the control over your online store for… ease of use and the convenience of setting up your eStore quick and easy, with no technical expertise   You do get a huge collection of plugins to choose from but… they all come with a price tag on; one that you’ll need to consider when planning out your budget   You won’t be able to customize every single aspect of your website. By comparison, Magento puts no limitation on the configurations that you can make to your site   Shopify provides you with weaker SEO features   It charges a transaction fee per… sale   4. Why Would You Choose Magento over Shopify? When dealing with a Magento vs Shopify 2020 dilemma, what could make you opt for Magento? Lots of reasons... Here are the strongest ones:   It enables you (or your team of Magento developers in Toronto) to customize everything about your eCommerce website, from theme to checkout process, to main menu, to email template, to...   You get to build custom functionality for your website, that’s not available on the market   You have lots of extensions available to choose from — Magento being open-sourced — and to customize your online store   You benefit from its strong SEO capabilities   You get to tap into its multi-store functionality: Magento enables you to manage all your online stores from one central dashboard   “In fact, according to eCommerce Platforms research Magento SEO scores 95 out of 100, and that is great result!” (source: Cart2Cart ) In short, you’d want to go with Magento because it enables you to build pretty much anything that you might need for your eCommerce website. 5. What About the Cons of Using Magento? For you need to be aware of the disadvantages of using this eCommerce solution, as well, before you make any decision. Now, here are the most… discouraging ones:   Building a fully customized website in Magento takes time and requires web development experience and Magento expertise; you can’t get away without a team of back-end Magento developers to handle the whole process and all the customization wok   You do have a large and thriving community to rely on, but no 24/7 dedicated support (like you have with Shopify)   You’ll need to optimize your Magento website on a regular basis to make sure it keeps performing at its best   You’ll need to take into account the cost of all the extensions that you might want to add, of the web hosting service, and the Magento expertise needed   6. Magento 2 vs Shopify vs... Shopify Plus: Which One’s the Best Fit? Considering that, starting June 2020, Magento 1.0 is no longer supported, your Magento vs Shopify 2020 dilemma turns into: “Magento 2 vs Shopify”. What new features does Magento 2 bring to the debate? simplified navigation (even) better customization capabilities better performance a more admin-friendly panel drag-and-drop layout editing improved checkout  “And what about Shopify Plus?” you might then ask yourself. Here are some of the enhancements that Shopify Plus ships with, so you can see for yourself whether it’s the best fit for what you’re looking for:   It gives you greater control over your online store: you gain more customization freedom   It’s robust enough to handle more than 10,000 transactions per minute, which makes it a viable alternative to Magento 2 for enterprise-level eCommerce businesses   You’re free to edit your checkout page (a feature that’s not available in Shopify)   You get your own launch manager: basically, a dedicated Shopify Plus team will handle everything for you, from implementing the custom Shopify theme that you need to code writing   7. Which Commerce Platform Works Better for Your Type of eCommerce Business? Now that you have a clear(er) picture of the pros and cons of Magento vs Shopify, how do you know which one’s the best fit for you? For your business goals and size? It’s simple: just pick the answer(s) that best fits your scenario from the following ones: You’ll want to use Magento if: you have a large product catalog your customization  needs are… above the average (i.e. complex product configurations): you want a fully customized online store built from the ground up you need a commerce platform robust enough to support your entire network of vendor/supplier fulfillment channels you have qualified Magento developers in your team (or the budget to hire some professionals, who know what they’re doing) You’ll want to use Shopify over Magento in 2020 if: it’s a small to medium product catalog that you need to set up being able to integrate/cross-sell on multiple platforms is a crucial feature for you you need to get your storefront online as quickly as possible Does this head-to-head help you with your Magento vs Shopify 2020 dilemma?  No matter which one’s the “winner”, the next question stays the same: “How do I get my Shopify/ Magento website built and suited to my needs?" Just drop us a line and we’ll have either our Shopify or our Magento expert team assigned to your eCommerce project! Image by Photo Mix from Pixabay  ... Read more
Adriana Cacoveanu / Sep 18'2020
5 tips to pass your Acquia Site Studio (Cohesion) Certification Exam
A few weeks ago, I had the chance to take the Acquia Site Studio (formerly Cohesion) Certification exam. In this post we are going to discuss why I took this exam and more importantly, how I passed it and became an Acquia Certified Site Studio Site Builder. Optasy and its commitment to quality through knowledge You already know that quality is part of the corporate culture of Optasy. For us quality is a key factor to protect our clients' investments and guarantee them a high ROI. But having a good QA department is not enough. Actually, it's often too late when the QA team detects an issue. At Optasy we prefer to ensure quality at the early stages of our projects, analyzing deeply the needs of our clients and transform them into effective digital experiences but we also know that the quality of the code we produce comes from the experience and the skills of our developers. That's why Optasy has an internal 'skill knowledge acquisition program' to help its employees (optasians) to acquire new skills or improve them. This program gives to each optasian one day off per month (paid by the company) to study a particular field. As a way to ensure knowledge acquisition and validation, optasians also receive paid leave to study and give their Acquia certification exams. This includes the exam cost too, that’s why many of the optasian developers are actually Acquia Certified developers or Acquia Certified site builders All things considered, it was a pretty easy choice for me to take the exam, not only do I get to improve my skills, but I get paid for it too! What are the Acquia certification programs? Acquia is a preferred Optasy partner that delivers a cloud-based digital experience platform built on Drupal that enables organizations to build experiences that scale. Acquia is committed to facilitating certification programs allowing developers to validate their Drupal skills year after year. Acquia certification exams are administered at Kryterion Testing Centers in more than 750 locations across the globe. Exams are also available as online-proctored tests and are often offered at DrupalCons across the world. What is Acquia Site Studio? Acquia Site Studio (formerly Cohesion) is a low-code solution for building and editing Drupal sites. As an Acquia partner, our team got the chance to become an early adopter of the technology.  Acquia Site Studio is a sort of layout builder on steroids without writing any line of code. Not only can you build layouts or templates, but also you can build whole websites from the headers to the footers, and everything in between, like components and widgets, just by using the interface. No code required! It's a kind of atomic design system (like Pattern Lab) where you can create and preview CSS style guides, components, template layouts, page layouts or view layout from a visual user interface with simple “drag and drop”. And all of this within your Drupal site! To be fair, Acquia Site Studio is an amazing tool allowing designers and marketers to create and modify any layout component without calling the development team. If you’re a designer with no coding knowledge you’ll be able to create totally unique layouts based on your designs using intuitive drag and drop layout builder. If you're an editor, you may choose the layout you want to use and add all the pre-designed components you wish. Want to add a slider or a 'Related Articles' block? You drag and drop it in your layout! 5 tips to successfully pass your Acquia Certified Site Studio exam As other Acquia Certification exams, the Certified Site Studio exam requires both experience and knowledge. Though the test is not difficult, it’s not something you want to run into unprepared. From my experience, the questions ranged from a very low to medium range of difficulty, there were barely any difficult questions. This exam validates your ability to: Understand the features and functionality provided by Site Studio Install and configure Site studio environment on new or existing websites. Build a website using Site Studio style builder, components and website structure design elements. The official description of this exam can be found on Acquia's certification overview page. But in short: The tests are all multiple choice. They don't require that you actually configure a Drupal site or write any code. They are available in person at a testing center, or at home by installing the exam software on your computer. The price was $155 (In my case, Optasy paid for the test) Get a good understanding of Drupal Layout Builder As I mentioned earlier, Acquia Site Studio is a Layout Builder on steroids and many concepts are the same, so having some experience with this Drupal module will help you a lot, like the inline editing tools or the concept of drawing element into the layout. This is not mandatory, but I felt really comfortable with Site Studio having this previous experience. Read carefully the contents of the exam On Acquia's certification overview page you'll find the blueprint of the exam like the following: But below it, you'll find the content itself. Read it carefully and repeatedly. This should be your guideline during your study. This will help you focus on what really matters but also to recap and structure your notes. Read and study the documentation While there are really good videos on the Acquia Academy site about Site Studio, watching all of them won't be enough. If you don't have prior experience with Site Studio, it's a good starting point. But it definitively won't give all the knowledge you need to pass the exam. Reading the documentation should sound obvious, but you'll really need to read and study all the documentation in depth. Don't leave anything behind cause the exam covers all the aspects of Site Studio, from the basics to more advanced topics. This will also give you the right vocabulary to understand the questions of the exam, since sometimes they can try to trick you changing just one word. So the technical vocabulary has an important role, and that's where the documentation comes into play. Write down some notes after reading each section. This will help you a lot during the recap! Train on the Acquia Site Studio demo environment You can request an online demo environment for free at the bottom of this page The main benefit is that you won't need an API key or an Agency key, so you can test Site Studio for free, the environment acts just like a normal Drupal website. and the site will be all yours to experiment on. This site will be your friend during your study, you should test everything you learned in the documentation here. Do it several times and try different cases. The night before the exam, after reading back your notes, try to build a site from scratch in this environment to recap all the main concepts. This is key! Don't forget the 'Miscellaneous concepts and features' part These three concepts are not placed in one section, they are dispersed in the documentation. Study and practice all of them because you'll have a question about each one. They are only three, it doesn’t sound like a lot but they are worth 15% of the exam! That is a quick and easy win! A bonus tip What really worked for me was to read a section, practice the concepts of this section in the demo environment, read again the same section and take some notes. The day after, read all the notes of the previous day, do the same 7 days later, reading back your notes and practicing again on the demo site. That way, 80% of what you studied will stay forever in your memory. Conclusions Acquia Certification Site Studio Site Builder can be a good way to validate your skills and knowledge There are barely any difficult questions Study all the documentation because the exam is based on it, but also because the exam will cover all of it. Practice a lot, recap a lot. ... Read more
Karim Boudjema / Aug 27'2020
Why Cloud-Native Apps? How Exactly Can Cloud Native Applications Benefit Your Business?
For it all comes down to this: what's the return that you'd get from switching to this new way of developing applications? Why cloud-native apps? How does migrating from cloud-hosted to cloud native applications translate into clear benefits for you? For your own business? We've listed them, then... shortlisted them to the 6 biggest benefits that you can expect from developing cloud native apps. Or, if you wish, the top 6 reasons why you'll want to use a cloud-native architecture from now on. But First: What Are Cloud Native Applications More Precisely? They're collections of independent, loosely coupled microservices, each one performing a single service or business function. Unlike the traditional "monolithic" app architecture, where you have a single... block. So that whenever you needed to apply even a small change, you had to interrupt the entire app. And it's precisely this intrinsic constraint of the monolithic approach — translating into limited scalability and flexibility — that has made the cloud-native model so "tempting": it allows you to develop and deploy each microservice independently so, whenever you need to apply changes, you're no longer constrained to wait first for all the components to get updated you can incorporate the new features (in many cases, suggested by users themselves) and deliver the app to your audience right away #1: You Get to Incorporate User Feedback into Your App in... Real-Time Why cloud-native apps? Due to their high availability: You get to make real-time changes to your applications... on the fly. ... to respond to users' expectations of specific new features and functionalities faster than with the traditional app development model. "Continuous improvement" is the key phrase here:   You're free to add and roll back new features and enhance its performance... constantly. On the go. #2: You Benefit from a Higher Developer Productivity And this is another one of the key cloud native application benefits. The cloud-native architecture: speeds up the development process helps your team save time, that they'd otherwise need to spend trying to solve various infrastructure issues and handling critical business requirements instead enables easy remote access to their system, irrespective of their location #3: Why Cloud-Native Apps? Because You Can Build, Update, and Deliver them Faster The cloud-native approach enables you to scale your resources and comply with user demand way faster than the monolithic approach: You get to bring new features online — requested by your users — more quickly. To roll out changes and start marketing your app much faster. In short, you get to be more responsive to user demand and more relevant with the updates you make to your app in… real time. #4: You Save Time and Money From all the cloud native applications advantages, cost-savings must be the most tangible one. And it’s pretty obvious if you come to think of it: Since the cloud-native approach to developing applications allows you to build and release them much faster, you’re practically left with more time. More time to focus on your other revenue-generating tasks. #5: You Can Make or Roll Back Small Changes Without "Freezing" the Entire App Why cloud native applications? Because you can minimize downtime when you need to update your app. #6: You Get to Run Your App on Multiple Platforms Cloud native applications run on both public and private platforms without you being forced to make any major changes. For “flexibility” (along with “efficiency” and “high availability”) is another word for cloud-native. So, Why Cloud-Native Apps? It’s simple: You get to innovate faster and to react to users’ changing needs and trends... faster. Do you already have an app idea and you just need the right team to, ask the right questions, grasp your vision, and… make it happen? Just drop us a line, let’s hear all about it and let's... build it! Image by Ashish Bogawat from Pixabay ... Read more
Adriana Cacoveanu / Aug 15'2020