Project

General

Profile

Build FWD Using Docker

Introduction

At this point, you have a working bash shell, Docker is installed and you have a working dbash.sh and fbash.sh helper scripts available.

The Docker development image launched with dbash.sh does not include a version of FWD inside it. The fbash.sh does. With either, you can download and build the FWD project locally (on your Docker host).

This section assumes that you want to checkout and build FWD from a repository. If you prefer a pre-built image, see Using a FWD Docker Image section, where a pre-built FWD image can be used. You can also build this FWD Docker image yourself locally (and optionally push to your own repository). See Build FWD Using Docker section for those details.

Within the Development Docker image there is a repository (/opt/repos) with projects stored so they can be retrieved locally. In a dbash.sh container, you can see the below directories:
  • /opt/repos/fwd/trunk
  • /opt/repos/hotel_chui
  • /opt/repos/hotel_gui
  • /opt/repos/skeleton
  • /opt/repos/possenet
  • /opt/repos/ade_tools_12_8_4

There are helpful tools to handle the bzr commands for source control:

  • fwd_checkout.sh - Checkout FWD branch and optionally build
  • fwd_build.sh - Perform a build of FWD
  • fwd_update.sh - Update FWD branch and optionally build
  • fwd_reset.sh - Revert a FWD branch and optionally build

Initial Branch Checkout

The revisions of the internal repository's projects will be current as of the time the latest Docker development image (basedev_ubuntu_24.04) was created. If you have a Golden Code xfer.goldencode.com ID, you can check out the most recent version from there using built-in tools. If you are internal to GCD, you can use the ~/secure mount to devsrv01.

Regardless, you should setup a project directory for the build:

mkdir -p ~/projects/fwd
cd ~/projects/fwd

The bzr commands can be issued directly from within dbash.sh Development image, or using the fwd_checkout.sh helper.

Repository Checkout

Issue these commands by either passing them to dbash.sh in the -c "<cmdline>" option, or simply enter the container with dbash.sh and run them. These examples assume the latter.

Check out the trunk Bazaar repository in the base image with:

bzr co /opt/repos/fwd/trunk

If you want to specify a location to checkout to, pass it to bzr:

bzr co /opt/repos/fwd/trunk mytrunk

or use the helper:

fwd_checkout.sh --internal_repo -t mytrunk

If you have a Golden Code provided xfer account (for example, "ges"), you can retrieve the latest revision of trunk with:

fwd_checkout.sh -u ges

Those users who are internal to Golden Code can include the -s option, and the ~/secure mount point will be used:

fwd_checkout.sh -s

For any of the commands above, a different branch other than trunk can be specified with the -b <branch> option. The internal repository only contains trunk, so this option is only valid when using an xfer or internal repository.

fwd_checkout.sh -u ges -b 9866c

NOTE: To use a special branch it will have to have been setup by Golden Code on the xfer.goldencode.com server in the /opt/fwd/<branch> directory.

SSH Error

If you are encountering an SSH error that looks like this while checking out the branch:

ssh: Could not resolve hostname xfer.goldencode.com: Temporary failure in name resolution
ConnectionReset reading response for b'BzrDir.open_2.1', retrying
ssh: Could not resolve hostname xfer.goldencode.com: Temporary failure in name resolution
brz: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist. 
ERROR: Failed to checkout trunk. Check that it is present at bzr+ssh://<user>@xfer.goldencode.com/opt/fwd/trunk.

A possible fix for that is to exit the Docker container and restart the Docker service:

exit
sudo systemctl restart docker

Build FWD

Given the above checkout retrieving the requested branch to your ./projects/fwd directory, you can perform a build with the dbash.sh Development container using fwd_build.sh helper.

cd trunk
fwd_build.sh

This will start the build of the current branch in the trunk directory. Note: There is a --build option to fwd_checkout.sh that will proceed with the build after the checkout is performed.

This will leave ~/projects/fwd/trunk with a usable FWD version for development in your environment.

Existing Branch Update

If you already have the branch in place, you can update that branch to a later revision using fwd_update.sh helper.

From bash:

cd fwd/trunk
dbash.sh -c "fwd_update.sh --build" 

This will update the branch and start the build.

Reset a Branch

If you have been making modifications to FWD, and want to restore the branch, you can use the fwd_reset.sh helper.

From bash:

cd fwd/trunk
dbash.sh -c "fwd_reset.sh --build" 

This will revert and clean-tree of the branch and start the build.

Create a FWD Docker Image

It can be useful to create your own FWD Docker Images for runtime use. The tools required are part of the FWD project in the ./tools/docker directory. There is a Dockerfile and a bash script to help use the Dockerfile to build the image. The helper tools mentioned in Build FWD Using Docker will create the distribution images necessary to build FWD Docker images. These are created by the "archive" target to gradlew. The tools cannot be run from within a Docker container.

Creating the Image

The ./docker/docker_build.sh in the tools directory will create up to 4 sets of images using the distribution archives:
  1. The main runtime image, which can be used for either client or, server without a database. It may or may not include PostGreSQL client (based on PostGreSQL being requested).
  2. The server runtime image, which is used for a server that supports a database. This is only created if PostgreSQL is requested.
  3. Development versions of the above which can be used for application conversion (if the --build-dev option is included).

The PostGreSQL versions that are supported are 14, 15, 16, and 17. The default is 17.

The images will consists of:
  • Based off base_ubuntu_24.04 image (and basedev_ubuntu_24.04 if --build-dev is included), which is created from the container project. See Building and Using Docker Images for details (TODO: needs updates).
  • Optional PostGreSQL client
  • FWD convert distribution ZIP file contents placed in the /opt/fwd-convert directory in the image. A /opt/fwd symlink is created to this location, and the FWD_LIB environment variable is defined for scripts to easily locate the FWD libraries.
  • FWD spawner files placed in the /opt/spawner directory from the spawner distribution ZIP. The postbuild.sh is allowed to run as sudo without prompting via the postbuild_admin file added to the /etc/sudoers.d/ directory.
    • spawn
    • postbuild.sh
    • aspectjrt-1.9.23.jar
    • p2j.jar

1. Run commands from the tools directory of your branch. Branch 9709e used as an example.

cd ~/projects/fwd/9709e/tools

2. Create 2 images and tag them "latest", include PostGreSQL 14

./docker/docker_build.sh --pg=14 --latest --from_repo=goldencode --build-dev

This will result in the below images being created (4 pairs of images, 2 tags per image):

REPOSITORY                                      TAG                                          IMAGE ID       CREATED         SIZE
fwddev_4.0_ubuntu_24.04_pg14_jdk17              9709e_16611                                  25e2d50e1d2a   3 minutes ago   7.7GB
fwddev_4.0_ubuntu_24.04_pg14_jdk17              9709e_latest                                 25e2d50e1d2a   3 minutes ago   7.7GB
fwddev_4.0_ubuntu_24.04_jdk17                   9709e_16611                                  093cc5fe7162   5 minutes ago   7.49GB
fwddev_4.0_ubuntu_24.04_jdk17                   9709e_latest                                 093cc5fe7162   5 minutes ago   7.49GB
fwd_4.0_ubuntu_24.04_pg14_jdk17                 9709e_16611                                  f0d00f0c5923   4 minutes ago   6.19GB
fwd_4.0_ubuntu_24.04_pg14_jdk17                 9709e_latest                                 f0d00f0c5923   4 minutes ago   6.19GB
fwd_4.0_ubuntu_24.04_jdk17                      9709e_16611                                  0c93d67188cf   6 minutes ago   5.98GB
fwd_4.0_ubuntu_24.04_jdk17                      9709e_latest                                 0c93d67188cf   6 minutes ago   5.98GB

The "jdk17" was found to have been the JDK used to build the distribution images, so the jdk17 images are created. This is done automatically by interrogating the p2j.jar file within the distribution ZIP file. Also, since --pg=14 was specified, the images with _pg14 in the name contain PG14 server, and the ones without have the PG14 client.

These images are now stored locally, and can be used with fbash.sh as mentioned in Using a FWD Docker Image. Include the -l option so the local image is used: fbash.sh -l --tag 9709e_latest

For reference,


© 2004-2026 Golden Code Development Corporation. ALL RIGHTS RESERVED.