update tizen version to tizen20231130
[tools/build.git] / build-vm-docker
1 #
2 # Docker specific functions
3 #
4 ################################################################
5 #
6 # Copyright (c) 2015 Oleg Girko
7 # Copyright (c) 2015 SUSE Linux Products GmbH
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2 or 3 as
11 # published by the Free Software Foundation.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program (see the file COPYING); if not, write to the
20 # Free Software Foundation, Inc.,
21 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 #
23 ################################################################
24
25 vm_verify_options_docker() {
26     VM_IMAGE=
27     VM_SWAP=
28 }
29
30 vm_startup_docker() {
31     local name="obsbuild.${BUILD_ROOT##*/}"
32     local vm_init_script_docker="/.build/build"
33     local docker_server=`cat /etc/hosts | grep docker | cut  -f 1`
34     local docker_port=`cat /etc/hosts | grep docker | cut  -f 2`
35     docker_port=${docker_port#docker}
36     docker -H $docker_server:$docker_port rm --privileged "$name" >/dev/null 2>&1 || true
37     docker -H $docker_server:$docker_port run --privileged\
38         --rm --name "$name" --cap-add=sys_admin --net=none \
39         -v "$BUILD_ROOT:/mnt" busybox /bin/chroot /mnt "$vm_init_script_docker"
40     BUILDSTATUS="$?"
41     test "$BUILDSTATUS" != 255 || BUILDSTATUS=3
42     cleanup_and_exit "$BUILDSTATUS"
43 }
44
45 vm_kill_docker() {
46     local name="obsbuild.${BUILD_ROOT##*/}"
47     docker stop -t 2 "$name" || true
48 }
49
50 vm_fixup_docker() {
51     :
52 }
53
54 vm_attach_root_docker() {
55     :
56 }
57
58 vm_attach_swap_docker() {
59     :
60 }
61
62 vm_detach_root_docker() {
63     :
64 }
65
66 vm_detach_swap_docker() {
67     :
68 }
69
70 vm_cleanup_docker() {
71     :
72 }
73