Project

General

Profile

Docker images » History » Version 1

ptrkrysik, 09/06/2018 09:57 AM

1 1 ptrkrysik
h1. Setting up the software and running with use of Docker
2
3
It's possible to run the software in Docker containers. This way is recommended for beginners.
4
5
_Note:_ at the moment, there is a build script for GR-GSM TRX only.
6
7
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.
8
9
h2. Building Docker image
10
11
You need to clone the "docker-playground" repository first:
12
13
<pre>
14
$ git clone git://git.osmocom.org/docker-playground/
15
</pre>
16
17
Then make sure you have stable Internet connection and enough disk space, and start building:
18
19
<pre>
20
$ cd docker-playground/
21
$ cd gr-gsm-master/
22
$ make build
23
</pre>
24
25
It will take a while...
26
27
As soon as the building process is finished, you should see the new images:
28
29
<pre>
30
$ docker image ls
31
REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
32
user/gr-gsm-master        latest              c5912ee7d6ae        About an hour ago   2.09GB
33
base/archlinux            latest              7477438791e3        28 hours ago        689MB
34
</pre>
35
36
Please note that *this container requires privileged access* to the host USB devices (USRPs).
37
38
h2. Running Docker image
39
40
Read the above part about [[SDR_PHY#Running|running]] first.
41
42
As soon as you build the image, feel free to start it:
43
44
<pre>
45
$ cd docker-playground/
46
$ cd gr-gsm-master/
47
$ make run
48
</pre>
49
50
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.
51
52
By default, Docker should create a network interface for interacting with containers:
53
54
<pre>
55
$ ip addr
56
# ...
57
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
58
    link/ether 02:42:13:85:c2:c9 brd ff:ff:ff:ff:ff:ff
59
    inet 172.17.0.1/16 scope global docker0
60
       valid_lft forever preferred_lft forever
61
</pre>
62
63
In this example, the host has 172.17.0.1 assigned. Remember this address.
64
65
_Note:_ make sure your firewall doesn't block the connections with Docker's interface.
66
67
The container itself should also have it's own address. You can check it:
68
69
<pre>
70
[root@f7e86148c1c2 tmp]# pacman -S net-tools
71
[root@f7e86148c1c2 tmp]# ifconfig
72
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
73
        inet 172.17.0.2  netmask 255.255.0.0  broadcast 0.0.0.0
74
        ether 02:42:ac:11:00:02  txqueuelen 0  (Ethernet)
75
        RX packets 40  bytes 139097 (135.8 KiB)
76
        RX errors 0  dropped 0  overruns 0  frame 0
77
        TX packets 32  bytes 2752 (2.6 KiB)
78
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
79
80
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
81
        inet 127.0.0.1  netmask 255.0.0.0
82
        loop  txqueuelen 1  (Local Loopback)
83
        RX packets 0  bytes 0 (0.0 B)
84
        RX errors 0  dropped 0  overruns 0  frame 0
85
        TX packets 0  bytes 0 (0.0 B)
86
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
87
</pre>
88
89
Now, make sure your hardware is available within the container:
90
91
<pre>
92
[root@f7e86148c1c2 tmp]# uhd_find_devices
93
# Device list will appear here
94
</pre>
95
96
And finally, start the transceiver:
97
98
<pre>
99
# You need to use IP address of the host
100
[root@f7e86148c1c2 tmp]# grgsm_trx --remote-addr 172.17.0.1
101
</pre>
102
103
and trxcon on the host side:
104
105
<pre>
106
$ cd osmocom-bb/src/host/trxcon/trxcon/
107
108
# You need to use IP address of the host
109
$ ./trxcon --trx-ip 172.17.0.2
110
</pre>
111
112
That's it!
Add picture from clipboard (Maximum size: 48.8 MB)