Specifying Postbuild Events for Successful Docker Container Builds
InstallAnywhere 2020 SP2
InstallAnywhere offers the ability to perform one or more steps after each successful build of a Docker container:
• | You can have the built Docker image copied to your build machine. |
• | You can have the Docker container started; in addition, you can optionally override the default run command. |
To specify postbuild events for successful Docker container builds:
1. | In the Advanced Designer, on the Build page, click Build Containers. The Build Containers view opens. |
2. | In the Docker Configuration area, in the Choose Container Configuration setting, select the configuration that you want to build. |
3. | In the Postbuild Events area, optionally configure the following settings as needed: |
• | Export to Build Machine—Specify whether you want to export the Docker container to your InstallAnywhere build machine after the container is built. |
• | Start Container—Specify whether you want to automatically start the Docker container on the Docker host after the container is built. |
• | Run Command—This setting is available if you select Yes for the Start Container setting. |
Specify the command that you want to be used to start your Docker container. The default command is a basic sample run command that you can customize or rewrite as needed:
docker run -d ContainerName:ContainerNumber
The following table explains the results that occur for each of the various combinations of values for the Export to Build Machine setting and the Start Container setting.
Export to Build Machine Setting Value |
Start Container Setting Value |
Results |
||||||
Yes |
Yes |
In this scenario, the image is not deleted from the Docker host. |
||||||
Yes |
No |
In this scenario, the container is not started on the Docker host. |
||||||
No |
Yes |
The container is started on the Docker host. In this scenario, the image is not copied to the InstallAnywhere build machine, and the image is not deleted from the Docker host. |
||||||
No |
No |
In this scenario, the image is not copied to the InstallAnywhere build machine, the container is not started on the Docker host, and the image is not deleted from the Docker host. |
See Also