Create Different Images for Different Development Tasks

When implementing Docker to help you with your development work you need to create and run different images to carry out different parts of the development process. By having a number of different images you can be sure that you always use the right tools for the job, and that the images you use are optimized to carry out their particular tasks.

For example, if you are building a COBOL application you need to use an image that provides the support to enable you to do that, but if you only want to execute an application the image you use does not need to include the build functionality.

Working with different images for different purposes and basing images on other images are techniques used widely across the Docker community.

For instance, the Visual COBOL base image is extended with an extra image that has the environment setup for interactive login use.

This version of the image has the suffix _login in the repository name and can then be used for creating an interactive Docker session that has the COBOL development environment setup ready for use. See the description of the docker run -ti command in the Docker documentation for more information.

Micro Focus uses similar naming and image layering schemes in the Docker demonstrations that are supplied with Visual COBOL and recommends that you adopt the same sort of conventions.

For example, as described above, interactive login images typically have a suffix of _login in the repository name, so when creating an image called microfocus/vcdevhub:sles12sp3_4.0_x64 the interactive login image based on this image would be called microfocus/vcdevhub:sles12sp3_4.0_x64_login.