Create a Dockerfile
with the following content.
FROM ubuntu:16.04
RUN apt update
RUN apt install -y \
\
sudo sqlite3 libxml2 psmisc
python2.7-minimal net-tools kmodRUN apt install -y \
\
mercurial gcc g++ libxml2-dev automake \
m4 autoconf libtool pkg-config
make python-dev libsqlite3-dev binutilsRUN apt install -y \
vim iputils-ping rsyslog
RUN cd /root && hg clone http://hg.code.sf.net/p/opensaf/staging opensaf-staging
WORKDIR /root/opensaf-staging
RUN ./bootstrap.sh
RUN ./configure --enable-tipc CPPFLAGS="-DRUNASROOT"
RUN make -j `nproc`
RUN make install
RUN ldconfig
Build docker image.
$ docker build --progress=plain -t opensaf .
$ docker run --privileged -it --name node1 -h SC-1 opensaf
Generate /etc/opensaf/imm.xml
.
$ cd /usr/local/share/opensaf/immxml/
# generate nodes.cfg
$ ./immxml-clustersize --sc-count 1
Successful, result stored in the file ./nodes.cfg
$ ./immxml-configure
Successfully generated the imm file: ./imm.xml.20241012_1044
$ cp imm.xml.20241012_1044 /etc/opensaf/imm.xml
Edit /etc/opensaf/dtmd.conf
.
DTM_NODE_IP=172.17.0.2
# 172.17.0.2: IP of the eth0 interface.
Edit /etc/opensaf/node_name
.
SC-1
# SC-1: hostname.
Start OpenSAF.
$ /etc/init.d/opensafd start
Check status.
$ /etc/init.d/opensafd status
safSISU=safSu=SC-1\,safSg=NoRed\,safApp=OpenSAF,safSi=NoRed1,safApp=OpenSAF
saAmfSISUHAState=ACTIVE(1)
safSISU=safSu=SC-1\,safSg=2N\,safApp=OpenSAF,safSi=SC-2N,safApp=OpenSAF
saAmfSISUHAState=ACTIVE(1)
Check node.
$ amf-find node
safAmfNode=SC-1,safAmfCluster=myAmfCluster