Modern Apps git

xtool.git

Public
git clone https://git.maproj.org/xtool.git
appstore-distribution ▾

xtool.git / Dockerfile

Dockerfile113 lines · 2.9 KiBRaw
1# Note: We use 22.04 since AppImage recommends building on the
2# oldest configuration that you support
3
4ARG SWIFT_VERSION=6.4.1
5
6FROM swift:${SWIFT_VERSION}-jammy AS build-base
7
8RUN apt-get update \
9 && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
10 ca-certificates \
11 build-essential \
12 checkinstall \
13 git \
14 autoconf \
15 automake \
16 libtool-bin \
17 libssl-dev \
18 pkg-config \
19 libxml2 \
20 curl libcurl4-openssl-dev \
21 zip unzip \
22 liblzma-dev zlib1g-dev \
23 && rm -rf /var/lib/apt/lists/*
24
25
26FROM build-base AS build-limd
27
28RUN mkdir -p /prefix
29
30ADD --keep-git-dir=true https://github.com/libimobiledevice/libplist.git#2.6.0 /libplist
31
32RUN cd libplist \
33 && ./autogen.sh --prefix /usr --without-cython \
34 && make \
35 && make install \
36 && make install DESTDIR=/prefix
37
38ADD --keep-git-dir=true https://github.com/libimobiledevice/libimobiledevice-glue.git#1.3.1 /libimobiledevice-glue
39
40RUN cd libimobiledevice-glue \
41 && ./autogen.sh --prefix /usr \
42 && make \
43 && make install \
44 && make install DESTDIR=/prefix
45
46ADD --keep-git-dir=true https://github.com/libimobiledevice/libusbmuxd.git#2.1.0 /libusbmuxd
47
48RUN cd libusbmuxd \
49 && ./autogen.sh --prefix /usr \
50 && make \
51 && make install \
52 && make install DESTDIR=/prefix
53
54ADD --keep-git-dir=true https://github.com/libimobiledevice/libtatsu.git#1.0.4 /libtatsu
55
56RUN cd libtatsu \
57 && ./autogen.sh --prefix /usr \
58 && make \
59 && make install \
60 && make install DESTDIR=/prefix
61
62ADD --keep-git-dir=true https://github.com/libimobiledevice/libimobiledevice.git#master /libimobiledevice
63
64RUN cd libimobiledevice \
65 && ./autogen.sh --prefix /usr --without-cython \
66 && make \
67 && make install \
68 && make install DESTDIR=/prefix
69
70
71FROM build-base AS build-xtool-base
72
73COPY --from=build-limd /prefix/usr /usr
74
75WORKDIR /xtool
76
77FROM build-xtool-base AS dev
78
79# Docker doesn't support FUSE
80ENV APPIMAGE_EXTRACT_AND_RUN=1
81
82# Use the host's usbmuxd.
83# You probably want to use socat on the host to forward this port to /var/run/usbmuxd:
84# socat -dd TCP-LISTEN:27015,range=127.0.0.1/32,reuseaddr,fork UNIX-CLIENT:/var/run/usbmuxd
85ENV USBMUXD_SOCKET_ADDRESS=host.docker.internal:27015
86
87CMD [ "/bin/bash" ]
88
89FROM dev AS dev-test
90
91ENV XTL_TEST_ENV=1
92
93COPY --from=bats/bats:latest /opt/bats /opt/bats
94COPY --from=bats/bats:latest /usr/lib/bats /usr/lib/bats
95RUN ln -s /opt/bats/bin/bats /usr/local/bin/bats
96
97FROM build-xtool-base AS build-xtool
98
99ARG XTL_CI
100
101ADD Package.swift Package.resolved /xtool/
102RUN swift package resolve
103
104ADD . /xtool
105RUN ./Linux/build.sh
106
107FROM swift:${SWIFT_VERSION} AS xtool
108
109COPY --from=build-xtool /xtool/Linux/packages/xtool-*.AppImage /xtool/xtool.AppImage
110RUN (cd /xtool && ./xtool.AppImage --appimage-extract) \
111 && mv /xtool/squashfs-root /usr/local/xtool \
112 && rm -rf /xtool \
113 && ln -s /usr/local/xtool/AppRun /usr/local/bin/xtool