This topic describes how to run a
base image and volume mount an application's executable and debug files so that you can debug the application.
Note: This topic does not apply if you are using
Visual COBOL Development Hub as a stand-alone development environment.
When you run the container, you must make sure that the
docker run command specifies the following in addition to any parameters that you would normally specify:
- If the application to be debugged is a native COBOL application, the entry point
cobdebugremote (for 32-bit systems) or
cobdebugremote64 (for 64-bit systems) to overwrite the default entry point for the container. This means that when the container runs it starts
the process that is required to enable remote debugging rather than the entry point for the application that is to be debugged.
- The port that the container will listen on. If using DHCP or TCP tunneling in the container, the port must be specified by
an EXPOSE command in the Dockerfile that was used to create the image
For example, the following is a
docker run command you could use to run the native COBOL Hello World Docker demonstration that had been built into an image for use
on 64-bit
Red Hat Linux platforms:
docker run -p 6100
--cap-add=SYS_PTRACE
--name helloworld-x64-debug
-v /home/user/workspace/simpleproj/New_Configuration.bin:/home/root_docker/app
--workdir /home/root_docker/app
-it microfocus/vcdevhub:rhel7_5.0_x64_login
The parameters specified in the above
docker run command are as follows:
- -p 6100
- Publishes port number 6100. This must be specified by an EXPOSE command in the Dockerfile that was used to create the image.
- --cap-add=SYS_PTRACE
- Enables debugging inside a Linux container.
- --name helloworld-x64-debug
- Specifies the name to be used for the container.
- -v
/home/user/workspace/simpleproj/New_Configuration.bin:/home/root_docker/app
- Mounts the local folder
/home/user/workspace/simpleproj/New_Configuration.bin into the folder
/home/root_docker/app in the container.
- --workdir
/home/root_docker/app
- Sets the working directory for the container. This must be the same folder that is specified by the
-v parameter.
- -it
- Specifies that the container runs interactively.
- microfocus/vcdevhub:rhel7_5.0_x64_login
- Specifies the name of the image to run.
When the container is running, if the application running is in native COBOL a message such as the following is displayed
to indicate that the container is running and
cobdebugremote (or
cobdebugremote64) is ready to connect for debugging:
Waiting for a connection on machine IP-address/container-name using port port-number.
Press 'Q' to quit.