From 905e13ad3c60624e63d0081524d3beac9341a033 Mon Sep 17 00:00:00 2001 From: Cameron Cross Date: Thu, 2 Feb 2023 06:24:47 +1100 Subject: [PATCH 1/2] Add docker scripts to simplify setting up idevicerestore --- README.md | 11 ++++++++ docker/Dockerfile | 71 +++++++++++++++++++++++++++++++++++++++++++++++ docker/run.sh | 5 ++++ 3 files changed, 87 insertions(+) create mode 100644 docker/Dockerfile create mode 100755 docker/run.sh diff --git a/README.md b/README.md index 3b525678..71b1742f 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,17 @@ idevicerestore --help man idevicerestore ``` +### Docker + +Execute `run.sh` in the docker folder, +which will build a docker container with the latest source versions of all required libraries, +and then will execute `idevicerestore --latest` + +After running the script once, the container can be reused with: +```shell +docker run -it --privileged -v "$(pwd):/tmp" idevicerestore-docker idevicerestore [optional commandline args] +``` + ## Contributing We welcome contributions from anyone and are grateful for every pull request! diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..19b25155 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,71 @@ +FROM ubuntu:18.04 +RUN apt-get update && apt-get install -y \ + build-essential \ + pkg-config \ + checkinstall \ + git \ + autoconf \ + automake \ + libtool-bin \ + libreadline-dev \ + libusb-1.0-0-dev \ + libcurl4-openssl-dev \ + libssl-dev \ + libzip-dev \ + zlib1g-dev \ + python3 \ + cython + +RUN git clone https://github.com/libimobiledevice/libplist.git && \ + cd libplist && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm libplist -rf + +RUN git clone https://github.com/libimobiledevice/libimobiledevice-glue.git && \ + cd libimobiledevice-glue && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm libimobiledevice-glue -rf + +RUN git clone https://github.com/libimobiledevice/libusbmuxd.git && \ + cd libusbmuxd && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm libusbmuxd -rf + +RUN git clone https://github.com/libimobiledevice/libimobiledevice.git && \ + cd libimobiledevice && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm libimobiledevice -rf + + + +RUN git clone https://github.com/libimobiledevice/libirecovery.git && \ + cd libirecovery && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm libirecovery -rf + +RUN git clone https://github.com/libimobiledevice/idevicerestore.git && \ + cd idevicerestore && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm idevicerestore -rf + +RUN ldconfig +WORKDIR /tmp +CMD idevicerestore \ No newline at end of file diff --git a/docker/run.sh b/docker/run.sh new file mode 100755 index 00000000..c652ede5 --- /dev/null +++ b/docker/run.sh @@ -0,0 +1,5 @@ +#!/bin/bash +cd "$(dirname "$0")" + +docker build . -t idevicerestore-docker +docker run -it --privileged -v "$(pwd):/tmp" idevicerestore-docker idevicerestore --latest \ No newline at end of file From ff4855544e4dcb0e3d46ab88172a0d8e56944edb Mon Sep 17 00:00:00 2001 From: Cameron Cross Date: Tue, 24 Sep 2024 08:00:51 +1000 Subject: [PATCH 2/2] Update to include libtatsu, and a newer version of Ubuntu --- docker/Dockerfile | 17 +++++++++++++---- docker/run.sh | 3 ++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 19b25155..97bd9dc7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,6 @@ -FROM ubuntu:18.04 +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND="noninteractive" RUN apt-get update && apt-get install -y \ build-essential \ pkg-config \ @@ -13,8 +15,7 @@ RUN apt-get update && apt-get install -y \ libssl-dev \ libzip-dev \ zlib1g-dev \ - python3 \ - cython + python3 RUN git clone https://github.com/libimobiledevice/libplist.git && \ cd libplist && \ @@ -24,6 +25,14 @@ RUN git clone https://github.com/libimobiledevice/libplist.git && \ cd .. && \ rm libplist -rf +RUN git clone https://github.com/libimobiledevice/libtatsu.git && \ + cd libtatsu && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm libtatsu -rf + RUN git clone https://github.com/libimobiledevice/libimobiledevice-glue.git && \ cd libimobiledevice-glue && \ ./autogen.sh && \ @@ -68,4 +77,4 @@ RUN git clone https://github.com/libimobiledevice/idevicerestore.git && \ RUN ldconfig WORKDIR /tmp -CMD idevicerestore \ No newline at end of file +CMD idevicerestore diff --git a/docker/run.sh b/docker/run.sh index c652ede5..16996c43 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -1,5 +1,6 @@ #!/bin/bash +set -e cd "$(dirname "$0")" docker build . -t idevicerestore-docker -docker run -it --privileged -v "$(pwd):/tmp" idevicerestore-docker idevicerestore --latest \ No newline at end of file +docker run -it --privileged -v "$(pwd):/tmp" idevicerestore-docker idevicerestore --latest