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..28c9a49f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM ams21/cmake:3 AS builder +WORKDIR /build + +COPY . . +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 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/lib/libcrypto.so.3 /usr/lib/libcrypto.so.3 + +ENTRYPOINT ["/app/unshield"] \ No newline at end of file diff --git a/README.md b/README.md index cdd919aa..b75e9195 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 -u$(id -u):$(id -g) --volume $(pwd):/data unshield:latest [ARGS] +```