Project

General

Profile

Docker images » History » Revision 2

Revision 1 (ptrkrysik, 09/06/2018 09:57 AM) → Revision 2/5 (ptrkrysik, 09/06/2018 10:02 AM)

h1. Setting up the software and running with use of Docker 

 It's possible to run the software in Docker containers. This way is recommended for beginners. 

 _Note:_ at the moment, there is a build script for GR-GSM TRX only. 

 The build script for [[gr-gsm:]] (i.e. Dockerfile) is shipped as a part of a separate project called "docker-playground". It's based on "base/archlinux" image, which provides the recent versions of both UHD and GNU Radio without tons of dependencies such as Xorg, GTK, fonts, etc. 

 h2. Building Docker image 

 You need to clone the "docker-playground" repository first: 

 <pre> 
 $ git clone git://git.osmocom.org/docker-playground/ 
 </pre> 

 Then make sure you have stable Internet connection and enough disk space, and start building: 

 <pre> 
 $ cd docker-playground/ 
 $ cd gr-gsm-master/ 
 $ make build 
 </pre> 

 It will take a while... 

 As soon as the building process is finished, you should see the new images: 

 <pre> 
 $ docker image ls 
 REPOSITORY                  TAG                   IMAGE ID              CREATED               SIZE 
 user/gr-gsm-master          latest                c5912ee7d6ae          About an hour ago     2.09GB 
 base/archlinux              latest                7477438791e3          28 hours ago          689MB 
 </pre> 

 Please note that *this container requires privileged access* to the host USB devices (USRPs). 

 h2. Running Docker image 

 Read the above part about [[Usage|running]] [[SDR_PHY#Running|running]] first. 

 As soon as you build the image, feel free to start it: 

 <pre> 
 $ cd docker-playground/ 
 $ cd gr-gsm-master/ 
 $ make run 
 </pre> 

 The last command will drop you into a bash shell. As there are no build scripts for the higher layer applications of [[OsmocomBB:]], the following part assumes that you are running [[OsmocomBB:]] on the host side. 

 By default, Docker should create a network interface for interacting with containers: 

 <pre> 
 $ ip addr 
 # ... 
 5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default  
     link/ether 02:42:13:85:c2:c9 brd ff:ff:ff:ff:ff:ff 
     inet 172.17.0.1/16 scope global docker0 
        valid_lft forever preferred_lft forever 
 </pre> 

 In this example, the host has 172.17.0.1 assigned. Remember this address. 

 _Note:_ make sure your firewall doesn't block the connections with Docker's interface. 

 The container itself should also have it's own address. You can check it: 

 <pre> 
 [root@f7e86148c1c2 tmp]# pacman -S net-tools 
 [root@f7e86148c1c2 tmp]# ifconfig 
 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>    mtu 1500 
         inet 172.17.0.2    netmask 255.255.0.0    broadcast 0.0.0.0 
         ether 02:42:ac:11:00:02    txqueuelen 0    (Ethernet) 
         RX packets 40    bytes 139097 (135.8 KiB) 
         RX errors 0    dropped 0    overruns 0    frame 0 
         TX packets 32    bytes 2752 (2.6 KiB) 
         TX errors 0    dropped 0 overruns 0    carrier 0    collisions 0 

 lo: flags=73<UP,LOOPBACK,RUNNING>    mtu 65536 
         inet 127.0.0.1    netmask 255.0.0.0 
         loop    txqueuelen 1    (Local Loopback) 
         RX packets 0    bytes 0 (0.0 B) 
         RX errors 0    dropped 0    overruns 0    frame 0 
         TX packets 0    bytes 0 (0.0 B) 
         TX errors 0    dropped 0 overruns 0    carrier 0    collisions 0 
 </pre> 

 Now, make sure your hardware is available within the container: 

 <pre> 
 [root@f7e86148c1c2 tmp]# uhd_find_devices 
 # Device list will appear here 
 </pre> 

 And finally, start the transceiver: 

 <pre> 
 # You need to use IP address of the host 
 [root@f7e86148c1c2 tmp]# grgsm_trx --remote-addr 172.17.0.1 
 </pre> 

 and trxcon on the host side: 

 <pre> 
 $ cd osmocom-bb/src/host/trxcon/trxcon/ 

 # You need to use IP address of the host 
 $ ./trxcon --trx-ip 172.17.0.2 
 </pre> 

 That's it!
Add picture from clipboard (Maximum size: 48.8 MB)