2 # local test with docker-compose
7 mkdir -p /home/sysadmin/share
8 sudo docker run -dt --privileged -v /home/sysadmin/share/:/home/sysadmin/share/ -v /var/run:/var/run --name o2imsbuilder centos:7
11 ## Build O2 service images inside the builder container
15 sudo docker exec -it o2imsbuilder bash
20 curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
21 chmod +x /usr/local/bin/docker-compose
24 yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
26 yum install -y docker-ce
31 cd /home/sysadmin/share/
32 git clone "https://gerrit.o-ran-sc.org/r/pti/o2"
37 git clone --depth 1 --branch r/stx.7.0 https://opendev.org/starlingx/config.git
38 git clone --branch master https://opendev.org/starlingx/distcloud-client.git
39 (cd distcloud-client && git reset --hard eb4e7eeeb09bdf2e1b80984b378c5a8ea9930f04)
40 git clone --depth 1 --branch r/stx.7.0 https://opendev.org/starlingx/fault.git
49 ## utilize a server certificates signed by a self-signed CA
53 openssl genrsa -out my-root-ca-key.pem 2048
54 openssl req -x509 -new -nodes -key my-root-ca-key.pem -days 1024 -out my-root-ca-cert.pem -outform PEM
55 openssl genrsa -out my-server-key.pem 2048
56 openssl req -new -key my-server-key.pem -out my-server.csr
58 echo subjectAltName = IP:127.0.0.1 > extfile.cnf
59 openssl x509 -req -in my-server.csr -CA my-root-ca-cert.pem -CAkey my-root-ca-key.pem -CAcreateserial -out my-server-cert.pem -days 365 -extfile extfile.cnf
60 cat my-server-cert.pem my-server-key.pem > my-server.pem
64 Assuming, we can get following files after performing procedure above:
66 Local CA certificate - my-root-ca-cert.pem
67 Server certificate - my-server-cert.pem
68 Server key - my-server-key.pem
71 ## Bring up docker containers
78 docker logs -f o2_api_1
79 docker logs -f o2_watcher_1