From 0cee5553964f34f871ef305a0f789481a80b3dce Mon Sep 17 00:00:00 2001 From: DanteyPL <7003735+DanteyPL@users.noreply.github.com> Date: Tue, 30 Sep 2025 22:53:45 +0200 Subject: [PATCH 1/4] Working Dockerfile for unshield-dockerized --- .dockerignore | 6 ++++++ Dockerfile | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..38b10d21 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +Dockerfile +.* +ChangeLog +LICENSE +README.md +*.sh \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..b4eb7418 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM ams21/cmake:3 AS builder +WORKDIR /build + +COPY . . +RUN apk update && apk upgrade --no-cache && apk add --no-cache zlib-dev +RUN cmake . && make && make install + +FROM scratch AS unshield-dockerized +WORKDIR /data + +COPY --from=builder /usr/local/bin/unshield /app/unshield +# copy libs and musl loader to the same absolute paths used at runtime +COPY --from=builder /lib/ld-musl-x86_64.so.1 /lib/ld-musl-x86_64.so.1 +COPY --from=builder /usr/lib/libz.so.1 /usr/lib/libz.so.1 +COPY --from=builder /usr/local/lib/libunshield.so.1 /usr/local/lib/libunshield.so.1 + +ENTRYPOINT ["/app/unshield"] \ No newline at end of file From 5b1871b87c428971f22c543dab6ad03079e941b4 Mon Sep 17 00:00:00 2001 From: DanteyPL <7003735+DanteyPL@users.noreply.github.com> Date: Tue, 30 Sep 2025 22:54:07 +0200 Subject: [PATCH 2/4] Added dockerized unshield usage to README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index cdd919aa..b9e8c87b 100644 --- a/README.md +++ b/README.md @@ -92,3 +92,18 @@ cmake . make make install ``` + +Build From Dockerfile +----------------- + +Process requires having Docker Engine installed + +First build image +``` sh +docker build -t unshield:latest . +``` + +Now just enter your work directory with cab files and use +``` sh +docker run -it --rm --volume $(pwd):/data unshield:latest [ARGS] +``` From 1539881c04007ab743f019f5d5c3e9abbd7dac2e Mon Sep 17 00:00:00 2001 From: DanteyPL <7003735+DanteyPL@users.noreply.github.com> Date: Tue, 30 Sep 2025 23:02:44 +0200 Subject: [PATCH 3/4] Added to usage flag -u to preserve running user ownership --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b9e8c87b..b75e9195 100644 --- a/README.md +++ b/README.md @@ -105,5 +105,5 @@ docker build -t unshield:latest . Now just enter your work directory with cab files and use ``` sh -docker run -it --rm --volume $(pwd):/data unshield:latest [ARGS] +docker run -it --rm -u$(id -u):$(id -g) --volume $(pwd):/data unshield:latest [ARGS] ``` From b4a6b565020e733fc37b85520bc07e83ad3f2e5d Mon Sep 17 00:00:00 2001 From: DanteyPL <7003735+DanteyPL@users.noreply.github.com> Date: Wed, 1 Oct 2025 23:43:53 +0200 Subject: [PATCH 4/4] Added openssl-dev lib to image and added flags to cmake --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b4eb7418..28c9a49f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,16 +2,17 @@ FROM ams21/cmake:3 AS builder WORKDIR /build COPY . . -RUN apk update && apk upgrade --no-cache && apk add --no-cache zlib-dev -RUN cmake . && make && make install +RUN apk update && apk upgrade --no-cache && apk add --no-cache zlib-dev openssl-dev +RUN cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON . && make && make install FROM scratch AS unshield-dockerized WORKDIR /data COPY --from=builder /usr/local/bin/unshield /app/unshield -# copy libs and musl loader to the same absolute paths used at runtime +# copy all dynamically linked libs to the same absolute paths used at runtime +# COPY --from=builder /usr/local/lib/libunshield.so.1 /usr/local/lib/libunshield.so.1 COPY --from=builder /lib/ld-musl-x86_64.so.1 /lib/ld-musl-x86_64.so.1 COPY --from=builder /usr/lib/libz.so.1 /usr/lib/libz.so.1 -COPY --from=builder /usr/local/lib/libunshield.so.1 /usr/local/lib/libunshield.so.1 +COPY --from=builder /usr/lib/libcrypto.so.3 /usr/lib/libcrypto.so.3 ENTRYPOINT ["/app/unshield"] \ No newline at end of file