II. Start thinking Containers
If it cannot be containerised then change approach to make it possible
So you made your mind up, you like the benefits containers bring, such as workload isolation and packaging and focus on security. You also like the aspect of being able to architect your solutions from multiple smaller services and perform rapid releases to
Where to start with containerisation?
Any new piece of software should by default enter containerised format.
Lift and shift of existing, non-containerised, software is also possible - just keep reading…
The chances are that whatever you are trying to containerise has already been containerised. Simply search the official DockerHub for the piece of software you are after. Docker’s layered architecture allows you to build on top of other
Base Images. In other words, extend Base Images to fit your requirement, which is also referred to as multi-stage builds.
Base Imagesspeeds up your development process as you don’t have to
reinvent the wheelallowing you to focus on your requirement and implementation.
What is containerised?
What if I have an unusual requirement?
Then you can build on top of an existing Base Image and add your code or dependencies that are required for your piece of software.
What’s important to stress is that when I say
Think Containers I mean:
Treat your software as a bundle:
OS + Dependencies + Source Code.
encapsulate, at the minimum, core OS processes (IIS, nginx, port opening, write permission on file system, networking etc.), dependencies (DLLs, JARs, Gems etc) and source code (C#, Java, Python etc.) required for your software to perform its function in
For example, if you have .NET Core API which has dependency on a
proprietary DLL then simply use ADD or COPY statement in your Dockerfile to include it into the Image. From that point the dependency is there in predefined folder as expected by your source code.
Alternatively, you might need to run
proprietary executable while you build Image for your application or run an installation of a framework - in either case you simply add RUN statement and point it to the executable.