/ Installation  

The very easy "Docker installation" steps

Hi there AppWorks fans,

Welcome to a new installment of AppWorks tips.

Today is the day we’ve all been waiting for. Because today we do our Docker installation for AppWorks and if you read the latest posts from OpenText you might have seen that the Docker support for AppWorks is also ready for your production environment. So, now it’s the best time to show you how it’s done!


Let get right into it…

And the first thing we need to do is…Installing Docker? and make sure it’s running fine. Yes, but before you install Docker it’s good to know that Docker requires some settings to be enabled on your laptop/desktop!

Also, in the meantime you can request a license file for 20.2 on the OpenText support site if you don’t have that license file already. 20.2?…Yes, I know we are in the 20.3 era, but the post was written during the 20.2 era and it will not be that different. In previous posts we already described how to make this license request. Make sure you request and use a license for AppWorks version 20.2 (or 20.3 if you like) as the license is version specific! The FullQualitiedDomainName information is also still in place, but you’ll see that later in this post.


Enable Virtualization BIOS setting

This might be a tricky one as not all users have access to the BIOS of their hardware. So, it might be the case that you need to ask your administrator to help you on this setting.

If you are in control of your own hardware you should be able to enter the computer’s BIOS by hitting <F1> , <F2> or other key during startup of the computer. It depends per manufacturer, but look at google with a search like enter bios key {manufacturer}

When you are inside the BIOS make sure to enable the option called ‘Virtualization’. I found this URL where several manufacturers are explained too!


Enable Windows features

Then we need to enable some windows features. For this we open the ‘run’ command with short key <Windows-key> + <R> and in the run panel we type optionalfeatures

docker_001

In the ‘Turn Windows features on or off’ screen you need to enable these features:

  • Containers
  • Hyper-V
  • Virtual Machine Platform
  • Windows Hypervisor platform

Click OK to install them and do a restart of the system!

What I also did, but not sure if it is required are these 2 commands from an ‘Administrator’ command prompt:

dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

bcdedit /set hypervisorlaunchtype auto


Installing Docker

Now for the Docker installation. It’s easy…Just go ‘Docker Desktop’ and download the package. For me it’s the Windows package with the name ‘Docker Desktop Installer.exe’ that is almost 1Gb is size!

Start the installer and follow the screens:

docker_002

Hit OK on that first screen

docker_003

Some unpacking and installing….

docker_004

Hit Close….that’s all!

On your desktop you will see that bright and shining Docker logo icon that lets you start the Docker platform on your desktop! In the taskbar of Windows you’ll see a small Docker icon too that is telling us that the platform is starting…You can get a coffee! ☕

And wait for this screen:

docker_005

No need to login or create any account in this screen! You need it when you want to save/share your own images on Docker hub (like GitHub for code, but this hub is for Docker images.)

Now open a command prompt or PowerShell prompt and type docker version for some result like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Client: Docker Engine - Community
Version: 19.03.8
API version: 1.40
Go version: go1.12.17
Git commit: xxxxxxx
Built: Wed Mar 11 01:23:10 2020
OS/Arch: windows/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: xxxxxxx
Built: Wed Mar 11 01:29:16 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.13
GitCommit: xxxxxxx
runc:
Version: 1.0.0-rc10
GitCommit: xxxxxxx
docker-init:
Version: 0.18.0
GitCommit: xxxxxxx

Docker play time

Now you have Docker up and running take an hour to play with it. It’s not hard, but you need to learn the basics, so you understand how the platform works with Images, Containers, Volumes and Networks. These 4 components will be used in the AppWorks containerization package too!

You first shot would be to start with the ‘Get started’ part on the documentation.

The next part on other components (like Docker Compose) is the general documentation

Once you know about the Dockerfile, how to build an image, create a container out of it and how to start and reach it you’ll be on the correct path of knowledge…If you already read some information about ‘Docker Compose’ too it gives you some benefit and you can continue this post!


Enable Docker “File sharing”

A feature we need to enable is ‘file sharing’. You can enable this feature in the Docker settings which is accessible from that small icon in the Windows taskbar. Apply the change and restart docker with that blue button.

docker_006


Docker memory settings

As we are in the Docker settings make sure Docker can claim enough resources from your system. For the AppWorks platform I claim 9Gb from my current 16Gb available. With a pre-run this was enough as I also require resources for my local Windows machine! You can play with these settings based on your system hardware. Also apply these changes!

docker_006_1


Download the Docker package

Yes, now we are ready for the AppWorks docker installation files. This can be found here (In the ‘AppWorks Platform’ section and not the whole ‘Suite’ section!) Also, only the platform is containerized and not OTDS or other related services (like the Gateway software). This is the same link, only directly to the download file!

Once you’ve downloaded the (330Mb) file ‘appworks-platform-20.2-containerization.tar.gz’ you can extract the content to a new folder on your local machine. I use 7-Zip for this…This gives you another file ‘appworks-platform-20.2-containerization.tar’ that you can also extract.

The end folder should have this content available in the end…Yes…There is our ‘Dockerfile’ and ‘docker-compose.yml’!

docker_007


Update the resources

Some files in this extracted folder need an update based on your license file…There you have it! 😜

You license file has some values we need to add in the Docker package

1
2
3
4
5
CustomerName= {Name of the customer}
SiteName= {Name of the site}
Host= {The FQDN hostname}
LicenseKey= {The license key}
Valid until= {The validation date until}

Now edit the ‘.env’ file with a notepad editor like Notepad++ and update these fields

1
2
3
LICENSE_CUSTOMER_NAME={Name of the customer}
LICENSE_SITE_NAME={Name of the site}
LDAP_HOST={The FQDN hostname}

Then we need to edit the file ‘/env/secrets/LICENSE_KEY’ where you can just paste in the whole license string.

In that same ‘secrets’ folder you can also find database password files. You can keep them as they are except for one and that is the ‘PLATFORM_PASSWORD’. I changed it to ‘admin’ just for my convenience.

You can also update the other passwords too, but keep in mind that some passwords have restrictions in size and characters that need to be used! That was my lesson learned once I changed all the passwords to ‘admin’ and continued my Docker journey…It was a failure!

Save those updated files and let’s go to the next step…


Build and run

Ready, set?…Go!

Make sure you Docker desktop is running as the real magic will start now!

Open a PowerShell or command prompt to the directory where those Dockerfile and docker-compose.yml files we just updated are located.

Start with this command: docker-compose -f docker-compose.yml build. It will build the Docker images from scratch!

You see a lot of output happening on the screen where each step (total of 63) can be seen. This is my output.

Now see what images are create with docker images

1
2
3
4
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
appworks/platform 20.2 c315eedce4e2 8 minutes ago 1.53GB
<none> <none> b1d5d8501025 8 minutes ago 1.8GB
openjdk 11.0.6-jdk 8ae694851c0d 2 weeks ago 627MB

Next step is to build the required containers out of our images with this command:

docker-compose -f docker-compose.yml -f docker-compose-openldap.yml -f docker-compose-postgres.yml up -d

Also here my output.

Now see what images are created with docker container ls with their health status. docker ps will give the same result!

1
2
3
4
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS                          PORTS                           NAMES
6c6c360337e0 appworks/platform:20.2 "/startup.sh" 2 minutes ago Restarting (1) 18 seconds ago appworks-platform-202-containerization_appworks_1
0af2ac858e28 postgres:alpine "docker-entrypoint.s…" 2 minutes ago Up 2 minutes (healthy) 0.0.0.0:5432->5432/tcp appworks-platform-202-containerization_database_1
b31d6d682da5 osixia/openldap:1.3.0 "/container/tool/run…" 2 minutes ago Up 2 minutes (healthy) 389/tcp, 0.0.0.0:636->636/tcp appworks-platform-202-containerization_ldap_1

Now you need to grab a coffee and wait for around 15 min. to get 3 healthy containers…Trust me, it happens eventually…If you followed the procedure! 😎

If you can’t wait and want to see some logging during your coffee you can do use this command docker logs {container_id} --follow --since 10min and use the container id of the ‘appworks/platform:20.2’ image!

Wait for these messages in the appworks/platform:20.2 container:

1
2
============= Total time to deploy the given caps : 16 minutes and 26.979 seconds.
/home/system/app/mp/health/ready HTTP/1.1" 200 1171

The ‘AppWorks’ playground is open

After you get those nice messages go to this URL from your local browser:

http://localhost:8080/home/system

docker_008

Use these credentials to login:

  • Username ‘sysadmin’
  • Password ‘admin’ -> We changed it in the PLATFORM_PASSWORD file…Remember!?

Other stuff

If you want to investigate any of the running container you can do this command to start a Unix bash command prompt:

docker exec -it {container_id} /bin/bash

This should look familiar to you:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
appworks@appworks:~$ ls -ls /opt/appworks/
total 1276
32 -rw-r--r-- 1 appworks appworks 32385 Mar 26 19:42 Copyright.txt
4 drwxr-xr-x 3 appworks appworks 4096 Apr 21 09:00 EntityExpression_DT
4 -rw-r--r-- 1 appworks appworks 166 Mar 26 18:27 GracefulShutdown.sh
4 drwxr-xr-x 1 appworks appworks 4096 Apr 21 10:11 Logs
4 drwxr-xr-x 3 appworks appworks 4096 Apr 21 09:01 RuleBuildingBlock_DT
868 -rw-r--r-- 1 appworks appworks 886778 Mar 26 19:42 'Third party licenses.txt'
4 -rw-r--r-- 1 appworks appworks 704 Apr 21 09:05 applicationservercp.jar
4 drwxr-xr-x 2 appworks appworks 4096 Apr 21 09:02 bin
4 drwxr-xr-x 3 appworks appworks 4096 Apr 21 09:00 captmp
4 drwxr-xr-x 3 appworks appworks 4096 Apr 21 09:37 cluster
8 drwxr-xr-x 1 appworks appworks 4096 Apr 21 09:02 components
8 drwxr-xr-x 1 appworks appworks 4096 Apr 21 09:38 config
4 -rw-r--r-- 1 appworks appworks 728 Mar 26 19:42 cordyscp.jar
4 drwxr-xr-x 2 appworks appworks 4096 Mar 26 18:48 crosscontext
4 drwxr-xr-x 2 appworks appworks 4096 Apr 21 09:01 ext
4 drwxr-xr-x 2 appworks appworks 4096 Apr 21 09:02 install_log
4 drwxr-xr-x 3 appworks appworks 4096 Mar 26 19:42 isvcontent
4 drwxr-xr-x 2 appworks appworks 4096 Apr 21 09:00 ldif
4 drwxr-xr-x 2 appworks appworks 4096 Mar 26 18:46 lib
284 drwxr-xr-x 7 appworks appworks 290816 Apr 21 09:02 localization
4 drwxr-xr-x 5 appworks appworks 4096 Apr 21 09:38 node
4 drwxr-xr-x 3 appworks appworks 4096 Apr 21 09:00 packages
4 drwxr-xr-x 3 appworks appworks 4096 Mar 26 18:36 warstaging
4 drwxr-xr-x 6 appworks appworks 4096 Mar 26 18:33 webroot

Same for this one:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
appworks@appworks:~$ ls -ls /usr/local/tomee/webapps
total 96868
4 drwxr-x--- 5 appworks appworks 4096 Apr 21 09:39 home#app#admin
1016 -rw-r--r-- 1 appworks appworks 1037104 Apr 21 09:00 home#app#admin.war
4 drwxr-x--- 8 appworks appworks 4096 Apr 21 09:39 home#app#documentservices
27276 -rw-r--r-- 1 appworks appworks 27927335 Apr 21 09:01 home#app#documentservices.war
4 drwxr-x--- 4 appworks appworks 4096 Apr 21 09:38 home#app#entityRestService
44352 -rw-r--r-- 1 appworks appworks 45415621 Apr 21 09:00 home#app#entityRestService.war
4 drwxr-x--- 4 appworks appworks 4096 Apr 21 09:38 home#app#entityWebService
32 -rw-r--r-- 1 appworks appworks 31843 Apr 21 09:00 home#app#entityWebService.war
4 drwxr-x--- 4 appworks appworks 4096 Apr 21 09:38 home#app#identity
2260 -rw-r--r-- 1 appworks appworks 2313118 Apr 21 09:00 home#app#identity.war
4 drwxr-x--- 4 appworks appworks 4096 Apr 21 09:39 home#app#mp
28 -rw-r--r-- 1 appworks appworks 25956 Apr 21 09:00 home#app#mp.war
4 drwxr-x--- 4 appworks appworks 4096 Apr 21 09:39 home#app#otdspush
1900 -rw-r--r-- 1 appworks appworks 1942362 Apr 21 09:00 home#app#otdspush.war
4 drwxr-x--- 5 appworks appworks 4096 Apr 21 09:39 home#app#start
18228 -rw-r--r-- 1 appworks appworks 18663932 Apr 21 09:00 home#app#start.war
4 drwxr-x--- 4 appworks appworks 4096 Apr 21 09:39 home#app#xecm
1740 -rw-r--r-- 1 appworks appworks 1780018 Apr 21 09:02 home#app#xecm.war

To stop the platform containers you can give command (from the directory where those Docker files are extracted!)

docker-compose stop

This only stops the main ‘appworks/platform:20.2’ container and docker-compose start will start it again…This startup takes again some time!

You can also stop the other containers like this:

docker container stop|start {container_id}

Is there more…? Yes…There is!

There is a very nice manual here called ‘AppWorks™ Platform Cloud Deployment Guide’ where you can find much more information about:

  • Creating images with your solution applied!…This is the core of containerization. So, no package deployment with manuals, but just building a new image, running a container out of it and you are ready!
  • Using other databases as we are now (by default) using the pre-configured PostgreSQL database, but maybe you already have something fancy database up and running.
  • Deploying on Kubernetes…For more scaling…Nice stuff too!
  • Administration tasks on the containers like log levels, HTTPS, CORS, SSL and remote debugging.

Removal/Cleaning up

This section is when ^&%(&^% hits the fan or if you just want to clean up your Docker components (except the images!)

docker-compose down

And if you also want to delete the related volumes you can do docker-compose down --volumes

If you want a full clean of all your Docker components (incl. images) do these steps:

  1. Stop all running containers docker stop $(docker ps -a -q)
  2. Cleans stopped containers, images, and networks docker system prune -a
  3. Cleans the left-over volumes (not in used any more) docker volume prune

This is also a great resource for removing Docker components!

To view if it’s all gone

1
2
3
4
docker images
docker container ls
docker volume ls
docker network ls #'bridge', 'host' and 'none' should still be there!

And that concludes our Docker installation on the AppWorks platform with a nicely earned “DONE”. And believe me…This is the future for the platform where you see that the DevOps way of working is also getting close. You see how easy you can generate new images (with or without a prepared solution) and generate new containers out of it that are scalable, maintainable, and consistent in structure! Pretty important keys for managing a large platform with high-availability, fail-over and a Development Test Education Acceptance Production architecture!

A lot of information learned again from this post. Leaves me by sending you away with a bright and sunny day…Have a good one and don’t forget to subscribe to get updates on the activities happening on this site.

Have you noticed the quiz where you find out if you are also “The AppWorks guy”? Great stuff!