Running the Development Containers Demonstration Base Image

Note: Micro Focus development containers are only available on Ubuntu platforms. See Product Information for a list of supported versions.

The development container demonstration to create a container in which you can use your Visual Studio Code editor in a well-defined development environment includes a shell script (bld.sh) to make the process of running the demonstration as easy as possible. This topic lists and describes the parameters that you can specify when running bld.sh.

Note: The product installers for the ... for docker products, such as Visual COBOL Development Hub for Docker, are supplied as a .tar file. For example devhub_dockerfiles_8.0_platform.tar for the base release, and devhub_dockerfiles_8.0_platform_patchupdate01.tar for the patch update installer. (The patch update installers provide the basic product images, but do not include the Hello World or other container examples; these are only provided with the base release.)

To obtain the bld.sh installation script, installable executable, and other files mentioned below, extract the provided .tar file into an empty directory on the container host machine. The files for the base release will be in a DevHub directory within the .tar file; the files for a patch update will be in the main directory extracted from the .tar file.

When using bld.sh to create a development container base image for Visual COBOL you need to ensure that the relevant licenses are available in the same folder as bld.sh. These are:
  • The installable executable file for Micro Focus Visual COBOL Development Hub. This is setup_visualcobol_devhub_for_docker_10.0_platform.gz and is supplied in the container demonstration for the Micro Focus Visual COBOL Development Hub base image.
  • The appropriate license (.xml) file for Micro Focus Visual COBOL Development Hub.
  • A locally-installed version of Visual Studio Code that contains the Remote Development extension pack. This pack contains four extensions that facilitate the opening of files and folders within a container. (The necessary Micro Focus extensions, required to provide the COBOL development tools and runtime environment, are installed during the demonstration setup.)
  1. Execute the shell script to build a development container base image:
    ./bld.sh { IacceptEULA devcontainer [options] }

    options enables you to specify a number of characteristics for the image, such as any ODBC or Java requirements, or auto-login credentials. For a full list of available options and their definitions, run ./bld.sh without specifying any other parameters.

    The DevContainer directory, within the Examples directory installed with the development product, contains a number of COBOL projects that you can open within the development container. This directory also contains a script that prepares the devcontainer.json files for each of those projects - this file is necessary to link the project with the development container.

  2. Follow the on-screen instructions to run the preparation script.

    The file specified as a parameter is an environment file that was generated during the creation of the dev container base image, containing the required environment settings to link each project with the container. The contents of this file is used to populate the ./<project>/.devcontainer/local/devcontainer.json file.

  3. Open Visual Studio Code in one of the project directories and it will recognize the project's .devcontainer folder structure, and prompt you to reopen the project in the development container.
    Tip: To view the image that the container is based on, navigate to the devcontainer.json file (located in the .devcontainer folder), and view the "image" value.
  4. If prompted, click Reopen in Container; alternatively, click the Remote Host connection (below), and then select Reopen in Container.

    Remote Host connection

    A development container is started and the project is opened within it. When you close the project, default behavior is that the container is stopped. This behavior can be changed by editing devcontainer.json; see https://code.visualstudio.com/docs/devcontainers/containers.