• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Docker in Practice - Use Cases

 
Ranch Hand
Posts: 576
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,
Is Docker useful for every deployment scenario or is better for certain situations?

Thank you,
Paul
 
Ranch Hand
Posts: 343
Mac OS X Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Docker gives you the opportunity to manage containers like never before. You don't have to worry about underlying platform to provide you an environment for your application to run. You can set docker to configure the container the way you want and carry the same container across platforms - your in-premises network to an EC2 instance. We love docker and are currently running some of our applications in docker and planning to move others to docker as well. It is easy to take a docker container from dev to prod given to understand that all our server instances are on cloud. I would say it may suit for most of your application needs.

Though other use it for microservices, we have gone a step-ahead and used docker to containerize our batch jobs, etc. There are certain things that need to be resolved like security, etc. but other than that docker is certainy a revolution in container automation and deployment adding a new hue to automation.
 
Author
Posts: 6
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

paul nisset wrote:
Hi,
Is Docker useful for every deployment scenario or is better for certain situations?

Thank you,
Paul



Hi Paul

Docker shines in many situations...but is completely inappropriate in others!

First, a few examples of where you wouldn't use Docker:
  • You want to distribute a Windows application for users to download and run - when Windows support is released and stable, it will only be for Windows server (for the foreseeable future)
  • You want to test device drivers or kernel modules for Linux - software requiring low level kernel integration or hardware access is possible to use in Docker (I believe!), but you lose a number of Docker benefits (e.g. container isolation is meaningless as all the changes are made to the host kernel) and you'll probably run into strange issues since this isn't an area with much testing.
  • You want to test your software on different kernel versions - Docker uses the kernel from the host, so this simply isn't possible.


  • For many other situations, Docker works fantastically well. Here are a few ways I've used (and continue to use) Docker:
  • As a local development environment - I install a bunch of software for whatever project I'm currently working on and save it as an image. This means I don't need to remember the way I installed a custom version of nodejs every time I want to upgrade, I just change my Dockerfile and rebuild.
  • As a lightweight environment to test applications in - from simulating the interaction between 20 different servers to seeing how your application runs on old Linux distributions, Docker can help.
  • Moving normal applications around on servers - this is the most typical use of Docker, to take applications with a number of dependencies, package them up in an image and run them on a server. The Docker ecosystem then gives a helping hand with building things on top of this, like zero-downtime upgrade for web applications and service discovery.


  • As with most things though, the real answer is "it depends". For example, consider the last point about deploying applications onto servers - if you have a single application running on a single server and already have a reliable and dead-simple method for deploying the latest version, Docker may increase complexity with little immediate benefit! But if down the line you're trying to move to another server and struggling because you forgot how you set up the server in the first place (which packages you installed, which config files you changed etc), that's probably a great opportunity to use Docker and end up with a repeatable build process to give you more flexibility in future.

    If you have a specific scenario in mind then I'd be happy to talk about it!
     
    paul nisset
    Ranch Hand
    Posts: 576
    2
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Hi ,
    Thank you for your responses.
    I was thinking of using it more in the way Palak mentioned


    You can set docker to configure the container the way you want and carry the same container across platforms - your in-premises network to an EC2 instance.




    simulating the interaction between 20 different servers

    seems like an interesting use for testing a service .
    If I were to this would I create/copy a new Docker instance for each server that would be calling the service?

    Thanks,
    Paul
     
    Author
    Posts: 11
    5
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    paul nisset wrote:
    Hi ,
    Thank you for your responses.
    I was thinking of using it more in the way Palak mentioned


    You can set docker to configure the container the way you want and carry the same container across platforms - your in-premises network to an EC2 instance.




    simulating the interaction between 20 different servers

    seems like an interesting use for testing a service .
    If I were to this would I create/copy a new Docker instance for each server that would be calling the service?

    Thanks,
    Paul



    With respect to carrying the container across platforms, Docker is very useful for this. But it's worth being aware of the following caveats:

    - You can run in to obscure kernel-related issues, especially if using unusual or 'bleeding edge' software (we talk about this in Chapter 12 in our book https://www.manning.com/books/docker-in-practice)
    - Data persistence can cause issues relating to 'data gravity'. While Docker containers can be easily 'lifted and shifted', and volumes offer a means of managing data, very often the real challenge with your deployments is managing large amounts of data associated with instances, and these can be harder to move.
    - Related to the previous comment, Docker encourages an ephemeral architecture. If your application is not designed for this, it can limit the benefits of using Docker.
    - Some Docker platforms (eg OpenShift) make subtle changes to the way applications are run (eg for security purposes, OpenShift does not allow containers to run as a specified user), and this can cause challenges

    Regarding your second point: yes, that would be a great (and cheap and quick-to-run) use case for Docker (to model your multi-server set up). Be aware that Docker containers are not VMs and while they can be treated as such, you may run into issues (eg with no init process). We discuss this extensively in the book, as it's an area of great contention, as many feel this is an 'impure' approach. Our view is that Docker is a tool that can save your organisation money, and if microservices doesn't make sense for you then you shouldn't be forced to go that route - software is a means to a (usually business) end, and not the other way around. We cover these issues in chapters 3 (using Docker as a VM) and 8 (Network Simulation: Realistic Environment Testing Without the Pain), and in places throughout the book.
     
    paul nisset
    Ranch Hand
    Posts: 576
    2
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Ian,

    I'm glad you mentioned OpenShift.
    I have couple applications on it and found deploying/updating apps more cumbersome than other platforms / hosting solutions.
    I'd be interested in trying to use something Docker with it.

    That is a good point about VMs .

    Your book sounds pretty useful from a practical perspective.

    thanks,
    Paul
     
    Ian Miell
    Author
    Posts: 11
    5
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks Paul, we hope it is!

    BTW are you referring to OpenShift v2 or v3? v3 is Docker/Kubernetes-based and is generally very easy to get going on. I'd be interested to know of other easier platforms.

    Ian
     
    paul nisset
    Ranch Hand
    Posts: 576
    2
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    OpenShift v2 or v3

    - To be honest I'm not sure .Probably the former.
    I was deploying from the Eclipse plug in and their were issues with it saying that the code had it had been pushed but the application didn't get updated .
    I was comparing this to platforms/hosts where you just upload a war file and it gets deployed to the server.

    It's been a while since I've played with it so it is probably worth my time revisiting OpenShift .

    The idea of deploying a single file that contains everything the the app needs is appealing.
     
    You can't expect to wield supreme executive power just because
    We need your help - Coderanch server fundraiser
    https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
    reply
      Bookmark Topic Watch Topic
    • New Topic