Convert a VxWorks 7 RTP to Container and Deploy With Dockerhub

Oct 19, 2021 | Docker, VxWorks

1 Introduction

Containers allow the packaging of VxWorks applications that are isolated from the rest of the system. VxWorks containers can be deployed into the cloud repository called Dockerhub, and distributed to VxWorks target boards from there.
In this blog, I will show how to convert a standard, example VxWorks RTP into a Container, push it to DockerHub, and then deploy to VxWorks.

VxWorks is a Real Time Operating System built by Wind River.

VxWorks has board support package (BSP) for the Raspberry Pi 4 model B target board.

The Raspberry Pi 4 board is a small and affordable computer board.

DockerHub is a repository where Docker users store and distribute container images.

Before attempting to follow this blog, make sure you have completed Using VxWorks 7 Containers With Dockerhub on a Raspberry Pi 4 Model B Board.

2 Prerequisites

These instructions assume that you are using:

1) A Raspberry Pi 4 model B board with 4GB RAM booting VxWorks
2) A USB-Serial TTL serial cable
3) A micro-SD card
4) A Windows workstation with the following installed on it:
5) Wind River VxWorks 7, SR21.07

The instructions assume you have a Docker Hub login. Refer to for details.

They also assume you have configured your workstation with the buildah utility. This is used to build OCI compliant containers. For details, refer to the VxWorks Container Programmer’s Guide, Configure the Build Workstation for Containers.

3 Related Documentation

For more information on these topics, refer to:

Wind River documentation:
VxWorks Container Programmer’s Guide

4 Prepare the Container-Enabled VxWorks Projects

4.1 Create and Build the Containers VxWorks Source Build (VSB) Project

Open a Windows command shell, configure the build environment, and then add the containers libraries to a newly created VxWorks source build (VSB) project:

cd <WIND_HOME>                  // your installation directory
wrenv -p vxworks\21.07
cd <YOUR_WORKSPACE>             // your workspace
vxprj vsb create -S -bsp rpi_4 -smp rpiVSB
cd rpiVSB                       // your VSB directory
                                // add the Containers runtime
vxprj vsb layer add CONTAINER_RUNTIME 
                                // add the Containers manager
vxprj vsb layer add CONTAINER_MANAGER      
                                // add the Containers Examples
vxprj vsb layer add PYTHON 
vxprj vsb layer add CONTAINER_EXAMPLES
vxprj vsb config -s -add _WRS_CONFIG_CONTAINER_PYTHON_WEB_SERVER=y 
                                // Build the VSB
vxprj vsb build -j 16
cd ..       

4.2 Create and Build the Containers VxWorks Image Project (VIP)

Create the VxWorks image project (VIP) as follows:

vxprj vip create -vsb rpiVSB llvm -profile PROFILE_DEVELOPMENT rpiVIP
cd rpiVIP
                                  // enable VIP container components
vxprj vip parameter set RAM_DISK_SIZE 0x4000000
vxprj vip component add INCLUDE_STANDALONE_SYM_TBL
vxprj vip component add INCLUDE_STANDALONE_DTB
                                    // enable PYTHON and ROMFS
mkdir romfs

4.3 Prepare the VxWorks Configuration for Public Internet Access

vxprj vip component add INCLUDE_PING INCLUDE_IFCONFIG
vxprj vip parameter setstring DNSC_PRIMARY_NAME_SERVER ""
vxprj vip parameter set SEC_VAULT_KEY_ENCRYPTING_PW \"vault_passwd\"
vxprj vip component add INCLUDE_IPCOM_USE_TIME_CMD

On linux hosts, set the SEC_VAULT_KEY_ENCRYPTING_PW as follows:

vxprj parameter set SEC_VAULT_KEY_ENCRYPTING_PW \"\vault_passwd\"

Set SEC_VAULT_KEY_ENCRYPTING_PW to an appropriate password which includes letters of varying case, and numbers.

4.4 Add Raspberry Pi 4 Specific Components

vxprj vip component add DRV_END_FDT_BCM_GENETv5 INCLUDE_XBD_PART_LIB
vxprj vip component add DRV_FDT_BRCM_2711_PCIE DRV_FDT_BRCM_2711_EMMC2
vxprj vip component add DRV_SDSTORAGE_CARD

4.5 Copy the VxWorks Container Certificate to the VIP ROMFS Directory

mkdir romfs\vxc\ca-certs
copy ..\..\vxworks\21.07\os\container\manager\ca-certs\ca-certificates.crt romfs\vxc\ca-certs\

4.6 Update the VxWorks bootline in the DTS File

Open the DTS file rpi_4_0_1_2_0\rpi-4b.dts in an editor.

Locate the chosen node in the DTS file.

Select an IP address for the target and configure the IP addresses in the VxWorks bootline correctly. For example:

bootargs = "genet(0,0)host:vxworks h= e= g= u=target pw=vx tn=RPi4";

4.7 Build the VIP

vxprj build

5 Create the Philosophers Example RTP Project

This example RTP project is provided by Wind River Workbench. It is an example VxWorks user-mode implementation of Edsger Dijkstra’s Dining Philosophers problem used to illustrate solutions to software synchronization issues.

1) Open Wind River Workbench.
2) Select File, New, Example.
3) Select the Philosophers Demonstration Program.
4) Select rpiVSB as the VxWorks source build for the RTP.
5) Build the RTP project.

6 Create a Container for Philosophers

6.1 Create a Directory for the Container

Return to your Windows command shell.

cd <YOUR_WORKSPACE>             // your workspace
mkdir philContainer             // a new directory for your new container

6.2 Copy the Philosophers RTP executable to the Container Directory

copy philosophers\rpiVSB_ARMARCH8Allvm_LP64_ld\philosophers\Debug\philosophers.vxe philContainer\.

6.3 Create the Container Dockerfile in an Editor

This file must be a text file and it must be named Dockerfile without a .txt extension to the directory name.

FROM scratch
WORKDIR /vxbin
COPY philosophers.vxe /vxbin
ENTRYPOINT ["philosophers.vxe"]
LABEL com.windriver.vxworks.rtp.rtpStackSize 0x400000
LABEL com.windriver.vxworks.rtp.rtpPriority 50
LABEL com.windriver.vxworks.rtp.rtpOptions 0x80
LABEL com.windriver.vxworks.rtp.rtpTaskOptions 0x00

Save the file in the philContainer directory.

If the editor appends .txt to the directory name on save, you must remove it. For example:

rename Dockerfile.txt Dockerfile

7 Build the philContainer OCI Image File

In the philContainer directory:

wsl buildah bud --arch arm64 --os vxworks -f Dockerfile -t philosophers
cd ..

8 Push the philContainer OCI Image File to DockerHub

wsl buildah push philosophers oci:philosophers.oci
wsl buildah push --creds dockerAccountName:dockerAccountPassword philosophers docker://dockerAccountName/philosophers.oci

dockerAccountName = the docker ID for your Docker Hub account
dockerAccountPassword = your Docker Hub account password

9 Pull philContainer to the VxWorks Target Board

9.1 Set the VxWorks date correctly

-> cmd
[vxWorks *]# date 2021-09-27
[vxWorks *]#

This instruction assumes the date of 27th September 2021. Set the date to the current date at time of using this blog.

9.2 Check your Internet connectivity

[vxWorks *]# C
-> ping ""
Pinging ( with 64 bytes of data:
Reply from bytes=64 ttl=114 seq=0 time=16ms
--- ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 17 ms
rtt min/avg/max = 16/16/16 ms
value = 0 = 0x0
-> cmd
[vxWorks *]# 

You may need to wait a while until the END driver finishes configuring the ethernet PHY. Once the RJ45 connector LEDs have stopped flashing, configuration is done.

9.3 Pull philContainer to the Target and Unpack the Bundle

[vxWorks *]# vxc pull dockerAccountName/philosophers.oci -k
[vxWorks *]# vxc unpack --image web_server.oci --rootfs layered /ram0/bundle

dockerAccountName = the docker ID for your Docker Hub account

9.4 Create the Container from the Bundle

[vxWorks *]# vxc create --bundle /ram0/philosophers phil
[vxWorks *]# cd /overlay/phil
[vxWorks *]# ls
[vxWorks *]# ls

9.5 Start the Container Running

[vxWorks *]# vxc start phil
Resume the RTP's initial task to end the demo.

Running claim-based solution.
Philosopher 1 is thinking...
Philosopher 3 is thinking...
Philosopher 4 is thinking...
Philosopher 2 is thinking...
Philosopher 5 is thinking...

9.6 Stop the Container Running

[vxWorks *]# vxc kill phil

Browse Category

Join our DO-178C group on LinkedIn

Got A Project In Mind?

We fix, develop and test embedded software for the aerospace & defence industry specialising in DO-178C safety-critical testing. Speak to us. We have laser focus, unprecedented attention-to-detail and provide phenomenal value.