1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
#===============================================================================
# This file is designed for Tizen infrastructure.
# Author onstudy@samsung.com
#===============================================================================
FROM flavio/opensuse-12-3
MAINTAINER onstudy@samsung.com
#### If you are use the proxy in your enviroment, add below line on building.####
#ENV ftp_proxy ftp://<ip>
#ENV http_proxy http://<ip>
#ENV https_proxy https://<ip>
#ENV socks_proxy socks://<ip>
#### addrepo opensuse 12.3 update os ####
RUN zypper --non-interactive addrepo "http://download.opensuse.org/update/12.3/openSUSE:12.3:Update.repo"
#### addrepo opensuse 12.3 obs v2.4 ####
RUN zypper --non-interactive addrepo "http://download.opensuse.org/repositories/OBS:/Server:/2.4/openSUSE_12.3/OBS:Server:2.4.repo"
### deleted repo in opensuse download site 07/24 ###
#RUN zypper --non-interactive addrepo "http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_12.3/devel:languages:python.repo"
#### addrepo tizen services,tools ####
RUN zypper ar -Gf -t rpm-md -n "Tizen Services (openSUSE_12.3)" http://download.tizen.org/services/archive/0.15.13/openSUSE_12.3 tizen-services
RUN zypper mr -p 1 "Tizen Services (openSUSE_12.3)"
RUN zypper ar -Gf -t rpm-md -n "Tizen Tools (openSUSE_12.3)" http://download.tizen.org/tools/latest-release/openSUSE_12.3 tizen-tools
RUN zypper mr -p 1 "Tizen Tools (openSUSE_12.3)"
RUN zypper --gpg-auto-import-keys --non-interactive refresh
#### Install some useful or needed tools
RUN zypper --non-interactive --no-gpg-checks ref
RUN zypper --non-interactive in --recommends vim tar wget telnet sudo
#### INSTALL supervisor ####
# download from http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_12.3/
# devel:languages:python.repo
ADD ./supervisor/supervisor-3.1.3-1.1.noarch.rpm /
ADD ./supervisor/python-meld3-1.0.0-1.1.noarch.rpm /
RUN zypper --non-interactive in --recommends python-meld3-1.0.0-1.1.noarch.rpm
RUN zypper --non-interactive in --recommends supervisor-3.1.3-1.1.noarch.rpm
RUN rm supervisor-3.1.3-1.1.noarch.rpm
RUN rm python-meld3-1.0.0-1.1.noarch.rpm
#### INSTALL OBS SERVER ####
RUN zypper --non-interactive in --recommends obs-server
RUN zypper --non-interactive in --recommends obs-utils
RUN zypper --non-interactive in --recommends obs-api
RUN zypper --non-interactive in --recommends obs-service-gbs
RUN zypper --non-interactive in --recommends obs-source_service
RUN zypper --non-interactive in --recommends qemu-linux-user
RUN zypper --non-interactive in --recommends build-initvm-x86_64 build-initvm-i586
#### Jenkins trigger#####
RUN zypper --non-interactive in --recommends obs-event-plugin
#### INSTALL APACHE2 ####
RUN zypper --non-interactive in --recommends apache2 apache2-mod_xforward rubygem-passenger-apache2 memcached
RUN zypper --non-interactive in --recommends \
php5 php5-gd php5-gettext php5-mbstring php5-mysql \
php5-pear php5-suhosin apache2-mod_php5 php5-bcmath \
php5-bz2 php5-calendar php5-curl php5-ftp php5-gmp \
php5-imap php5-ldap php5-mcrypt php5-odbc php5-openssl \
php5-pcntl php5-pgsql php5-posix php5-shmop php5-snmp \
php5-soap php5-sockets php5-sysvsem php5-wddx php5-xmlrpc \
php5-xsl php5-exif php5-fastcgi php5-sysvmsg php5-sysvshm
RUN sed -i 's/variables_order = "GPCS"/variables_order = "EGPCS"/g' /etc/php5/apache2/php.ini
RUN a2enmod passenger && a2enmod rewrite && a2enmod proxy && a2enmod proxy_http && a2enmod xforward && a2enmod headers && a2enmod status
RUN a2enflag SSL
#### INSTALL NTP ####
# ntp is essential protocol to synchronize time across multiple servers #
RUN zypper --non-interactive in --recommends ntp
#### INSTALL IPUTILS ####
# use ping from the ldap
RUN zypper --non-interactive in --recommends iputils
#### INSTALL PERL-GD ####
# use rebuild_time grapth
RUN zypper --non-interactive in --recommends perl-GD
#### INSTALL TO USE GIT-BUILDPACKAGE ####
RUN zypper --non-interactive in --recommends obs-service-git-buildpackage
#### INSTALL librpm-tizen ####
#require pacakge of librpm-tizen
RUN zypper --non-interactive in --recommends mozilla-nss
RUN zypper --non-interactive in --recommends librpm-tizen
RUN zypper clean
#### OBS Configuration ####
ADD ./obsserver/srv/www/obs/webui/lib/frontend_compat.rb /srv/www/obs/webui/lib/frontend_compat.rb
ADD ./obsserver/srv/www/obs/webui/app/assets/images/obs-logo_small.png /srv/www/obs/webui/app/assets/images/obs-logo_small.png
ADD ./obsserver/srv/www/obs/webui/app/assets/images/obs-logo_small.png /srv/www/obs/webui/public/assets/obs-logo_small.png
ADD ./obsserver/srv/www/obs/webui/app/assets/images/obs-logo_small.png /srv/www/obs/webui/public/assets/obs-logo_small-4c29268da14c390cb1aa768aa440acde.png
ADD ./obsserver/etc/apache2/vhosts.d/obs.conf /etc/apache2/vhosts.d/obs.conf
RUN sed -i 's/^\(Include \/etc\/apache2\/listen.conf.*\)$/# \1/' /etc/apache2/httpd.conf \
&& echo "Include /etc/apache2/conf.d/mod_passenger.conf" >> /etc/apache2/httpd.conf \
&& echo "repo-cache-dir = /srv/obs/git-buildpackage-repos/" >> /etc/obs/services/gbs \
&& mkdir -p /srv/obs/git-buildpackage-repos/ && chown -R obsrun:obsrun /srv/obs/git-buildpackage-repos/
#### "Adjust configuration for this hostname" ####
#### use local host to avoid SSL verification between webui and api ####
RUN sed -i 's,^ username: .*, username: <%= ENV['"'"'MYSQL_USER'"'"'] %>,' /srv/www/obs/api/config/database.yml \
&& sed -i 's,^ password: .*, password: <%= ENV['"'"'MYSQL_PASSWORD'"'"'] %>,' /srv/www/obs/api/config/database.yml \
&& sed -i 's,^ username: .*, username: <%= ENV['"'"'MYSQL_USER'"'"'] %>,' /srv/www/obs/webui/config/database.yml \
&& sed -i 's,^ password: .*, password: <%= ENV['"'"'MYSQL_PASSWORD'"'"'] %>,' /srv/www/obs/webui/config/database.yml
RUN sed -i 's/#use_xforward/use_xforward/g' /srv/www/obs/webui/config/options.yml \
&& sed -i 's/#use_xforward/use_xforward/g' /srv/www/obs/api/config/options.yml \
&& sed -i 's,^frontend_host: .*,frontend_host: "localhost",' /srv/www/obs/webui/config/options.yml \
&& sed -i 's,^frontend_port: .*,frontend_port: 81,' /srv/www/obs/webui/config/options.yml \
&& sed -i 's,^frontend_protocol: .*,frontend_protocol: "'"http"'",' /srv/www/obs/webui/config/options.yml
#### Fix ldap connection error(login user page)
RUN sed -i 's/ realname.toutf8/#fix FATAL error 2015.03.18 realname.toutf8/g' /srv/www/obs/api/app/models/user.rb
#### Fix Arm build error from qemu reg ####
#### qemu-arm-static --> qemu-arm-binfmt ####
RUN sed -i 's/static:/binfmt:P/g' /usr/lib/build/qemu-reg
#### Fix Http 500 Error ####
RUN sed -i '/our $ipaccess = {/a\ '"'"172'\\..*'"'"' => '"'"'rw'"'"'\, # only local docker ip' /usr/lib/obs/server/BSConfig.pm \
&& sed -i 's,^our.*\$repodownload.*=.*,our $repodownload = "http://$hostname:82";,' /usr/lib/obs/server/BSConfig.pm
RUN mkdir -p /srv/obs/certs && chown obsrun:obsrun /srv/obs/certs
RUN mkdir -p /srv/obs/repos && chown -R obsrun:obsrun /srv/obs/repos/
RUN chown -R wwwrun:www /srv/www/obs/api && chown -R wwwrun:www /srv/www/obs/webui
#### ADD RSYNC CONFIG ####
RUN sed -i 's/yes/no/g' /etc/xinetd.d/rsync
RUN rm /etc/rsyncd.conf
#### FIX MYSQL ####
RUN sed -i '/^\[mysqld\]/a\tmpdir=\/tmp\/' /etc/my.cnf
#### START SCRIPT ####
RUN mkdir -p /srv/script
ADD script/initdb.sh /srv/script/initdb.sh
ADD ./script/rsync.sh /srv/script/rsync.sh
ADD ./script/obsservice.sh /srv/script/obsservice.sh
ADD ./script/startup.sh /srv/script/startup.sh
ADD ./script/ca.sh /srv/script/ca.sh
ADD ./script/db.sh /srv/script/db.sh
ADD ./script/repos.sh /srv/script/repos.sh
RUN chmod +x /srv/script/*
ADD ./supervisor/supervisord.conf /etc/supervisord.conf
# Set environment variables.
ENV HOME /root
ENV TERM xterm
ENV TMOUT 1800
#### mysql database ####
ENV MYSQL_ROOT_PASSWORD opensuse
ENV MYSQL_API_DATABASE api_production
ENV MYSQL_WEBUI_DATABASE webui_production
ENV MYSQL_USER obs
ENV MYSQL_PASSWORD obspassword
ENV MYSQL_DATA_DIR_DEFAULT /var/lib/mysql
EXPOSE 80 81 82 443 444 5152 5252 5352
EXPOSE 3306
WORKDIR /srv/script
VOLUME ["/etc/mysql", "/var/lib/mysql","/var/run/mysql"]
CMD ["/bin/bash","/srv/script/startup.sh"]
|