Change workflow scheduled time to more "random" minute
[platform/core/system/upgrade-tools.git] / Dockerfile
1 # syntax=docker/dockerfile-upstream:master-labs
2 # Stage 1: bsdiff build image
3
4 ARG FROM_IMAGE_NAMESPACE=library
5 # Alternatively "docker-remote.bart.sec.samsung.net".
6
7 FROM ${FROM_IMAGE_NAMESPACE}/ubuntu:20.04 as build
8
9 COPY bsdiff /bsdiff
10 RUN apt-get update \
11         && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
12                 build-essential \
13                 cmake \
14                 git \
15                 libbrotli-dev \
16                 libdivsufsort-dev \
17                 pkg-config \
18         && cd bsdiff \
19         && cmake . \
20         && make install
21
22 # Stage 2: upgrade-tools image
23 FROM ${FROM_IMAGE_NAMESPACE}/ubuntu:20.04
24
25 RUN apt-get update \
26         && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
27                 aria2 \
28                 attr \
29                 brotli \
30                 file \
31                 git \
32                 libbrotli1 \
33                 libdivsufsort3 \
34                 python-apt \
35                 python-is-python2 \
36                 python2 \
37                 python3 \
38                 python3-apt \
39                 python3-pip \
40                 sudo \
41                 tar \
42         && rm -rf /var/lib/apt/lists/*
43 COPY --from=build --link /usr/local/bin/ss_bsdiff /usr/local/bin/
44
45 # TOTA upgrade tools
46 COPY --link --parents mk_delta/ scripts/ recovery/ /tota-upg/
47
48 # mass-delta-builder
49 RUN pip3 install \
50                 beautifulsoup4 \
51                 PyYAML \
52                 requests
53 COPY --link mass-delta-builder/pre_run.sh mass-delta-builder/mass-delta-builder.py /app/
54
55 # External plugin
56 ARG CFG_GIT_CLONE_PATH="https://git.tizen.org/cgit/platform/core/system/plugin/upgrade-tools-generic" \
57         CFG_GIT_BRANCH=tizen
58
59 RUN --mount=type=tmpfs,target=/tota-upg/mk_delta/temp \
60         git clone --branch "${CFG_GIT_BRANCH}" "${CFG_GIT_CLONE_PATH}" /tota-upg/mk_delta/temp \
61         && bash /tota-upg/scripts/directory-setup.sh /tota-upg/mk_delta/temp/ \
62         && cp -rf /tota-upg/mk_delta/temp/* /tota-upg/mk_delta/
63
64 WORKDIR /app
65
66 VOLUME /images /result /app/cfg