How to deploy CUBE in Docker


1. Install Docker in your machine. You can download and install Docker from the official website.

 2. Switch to Windows containers, by right-clicking on the docker icon as shown below:

 3. Create a directory for your Docker project. This will contain:

docker-project/
├── installers/
│   └── Setup_CONNECTIONClientx64_23.00.00.10.exe
│   └── Setup_CUBE_x64_06.05.01.00.exe
├── ps/
│   └── set_env.ps1
│   └── conn_client_logon_script.ps1
├── test-scripts/
│   └── test.S
└── Dockerfile

The content of the Dockerfile is provided in the example below:

FROM mcr.microsoft.com/windows:10.0.17763.4499 as base

SHELL ["powershell", "-command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# WORKDIR in the Docker image
WORKDIR "C:/work_folder"

# Copy installers in docker workdir for later installation
COPY installers/Setup_CUBE_x64_06.05.01.00.exe cube_setup.exe
COPY installers/Setup_CONNECTIONClientx64_23.00.00.10.exe connection_client_setup.exe

# Copy ps fileg in docker
COPY ps/set_env.ps1 set_env.ps1
COPY ps/conn_client_logon_script.ps1 conn_client_logon_script.ps1

# Silent installation for CUBE
RUN Start-Process -FilePath 'C:/work_folder/cube_setup.exe' -ArgumentList '/VERYSILENT', '/SUPPRESSMSGBOXES', '/INSTALLGIS=NO', '/AUTHORIZEGIS=NO' -Wait
# Silent installation for CONNECTION Client
RUN Start-Process -FilePath 'C:/work_folder/connection_client_setup.exe' -ArgumentList '/s', 'NoStartPostInstall=1', 'InstallDesktopShortcut=0' -Wait

# Start CC in production env
RUN "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine"
RUN .\set_env.ps1

# Copy a Voyager test script with the container workdir for later testing via command line in Docker container
COPY test-scripts/test.S test.S

The two ps files are provided below as example:

communities.bentley.com/.../set_5F00_env.ps1

communities.bentley.com/.../conn_5F00_client_5F00_logon_5F00_script.ps1

4. Build the image running the following command:

docker build -f .\Dockerfile . -t cube651

 5. Run the container with the following command:

docker run --rm -it cube651:latest

 6. Once inside the container, login to the connection client with your Bentley account using the provided powershell script, by running:

powershell
.\conn_client_logon_script.ps1 -UserName 'xxx_xxx@company.com' -Password '####' -NoNewWindow -Wait

 7. Test that CUBE 6.5.1 works, by running the test.S provided (or your own application)

runtpp.exe test.S