| 1 |
FROM ubuntu:20.04 |
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive |
| 4 |
|
| 5 |
## Change to bash |
| 6 |
|
| 7 |
RUN echo "dash dash/sh boolean false" | debconf-set-selections && dpkg-reconfigure dash |
| 8 |
|
| 9 |
RUN apt-get update && \ |
| 10 |
apt-get install -y --no-install-recommends \ |
| 11 |
ca-certificates \ |
| 12 |
build-essential \ |
| 13 |
git \ |
| 14 |
wget \ |
| 15 |
pkg-config \ |
| 16 |
make \ |
| 17 |
gcc-mingw-w64-x86-64 \ |
| 18 |
g++-mingw-w64-x86-64 \ |
| 19 |
dos2unix \ |
| 20 |
libssl-dev \ |
| 21 |
zlib1g-dev \ |
| 22 |
libncurses5-dev \ |
| 23 |
libncursesw5-dev \ |
| 24 |
libreadline-dev \ |
| 25 |
libsqlite3-dev \ |
| 26 |
libgdbm-dev \ |
| 27 |
libdb5.3-dev \ |
| 28 |
libbz2-dev \ |
| 29 |
libexpat1-dev \ |
| 30 |
liblzma-dev tk-dev \ |
| 31 |
unzip \ |
| 32 |
zstd \ |
| 33 |
curl \ |
| 34 |
tar |
| 35 |
|
| 36 |
WORKDIR /root |
| 37 |
|
| 38 |
## Ubuntu 20.04 cmake version is incompatible to recent win-iconv so we use our own |
| 39 |
RUN wget https://github.com/Kitware/CMake/releases/download/v3.25.3/cmake-3.25.3-linux-x86_64.sh && \ |
| 40 |
chmod +x cmake-3.25.3-linux-x86_64.sh && \ |
| 41 |
./cmake-3.25.3-linux-x86_64.sh --skip-license --prefix=/usr/local |
| 42 |
|
| 43 |
## Also 7z on ubuntu 20.04 is very outdated |
| 44 |
WORKDIR /root |
| 45 |
RUN git clone --branch 24.09 https://github.com/ip7z/7zip.git |
| 46 |
WORKDIR /root/7zip/CPP/7zip/Bundles/Alone2 |
| 47 |
RUN make -f makefile.gcc -j |
| 48 |
RUN cp /root/7zip/CPP/7zip/Bundles/Alone2/_o/7zz /usr/local/bin/7z |
| 49 |
|
| 50 |
## Iconv for windows |
| 51 |
WORKDIR /root |
| 52 |
RUN git clone --branch v0.0.10 https://github.com/win-iconv/win-iconv.git |
| 53 |
|
| 54 |
WORKDIR /root/win-iconv |
| 55 |
RUN cmake \ |
| 56 |
-D WIN_ICONV_BUILD_EXECUTABLE=OFF \ |
| 57 |
-D CMAKE_INSTALL_PREFIX=/opt/win-iconv-64 \ |
| 58 |
-D CMAKE_C_COMPILER=$(which x86_64-w64-mingw32-gcc) \ |
| 59 |
-D CMAKE_CXX_COMPILER=$(which x86_64-w64-mingw32-g++) \ |
| 60 |
. && \ |
| 61 |
make install |
| 62 |
|
| 63 |
## Ubuntu 20.04: Python version 3.10 is too old, it lacks support for non-GIL mode |
| 64 |
|
| 65 |
WORKDIR /root |
| 66 |
|
| 67 |
ENV PYTHON_VERSION=3.13.3 |
| 68 |
|
| 69 |
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \ |
| 70 |
tar xzf Python-${PYTHON_VERSION}.tgz |
| 71 |
|
| 72 |
WORKDIR /root/Python-${PYTHON_VERSION} |
| 73 |
|
| 74 |
RUN ./configure --prefix=/opt/linux-python && \ |
| 75 |
make -j && make install |
| 76 |
|
| 77 |
ENV PATH="/opt/linux-python/bin:$PATH" |
| 78 |
|
| 79 |
## Ubuntu 20.04: Rust is also too old, let's fetch a fresh one |
| 80 |
|
| 81 |
WORKDIR /root |
| 82 |
|
| 83 |
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable |
| 84 |
ENV PATH="/root/.cargo/bin:${PATH}" |
| 85 |
|
| 86 |
## For Windows we also need python |
| 87 |
|
| 88 |
WORKDIR /root |
| 89 |
|
| 90 |
RUN mkdir /opt/win-python |
| 91 |
WORKDIR /opt/win-python |
| 92 |
RUN wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-python-3.12.10-1-any.pkg.tar.zst |
| 93 |
RUN unzstd mingw-w64-x86_64-python-3.12.10-1-any.pkg.tar.zst |
| 94 |
RUN tar -xf mingw-w64-x86_64-python-3.12.10-1-any.pkg.tar |
| 95 |
|
| 96 |
## Custom patches |
| 97 |
|
| 98 |
WORKDIR /root |
| 99 |
|
| 100 |
COPY docker/patches/ /root/patches/ |
| 101 |
|
| 102 |
RUN git clone https://github.com/hashcat/hashcat.git |
| 103 |
|
| 104 |
WORKDIR /root/hashcat |
| 105 |
|
| 106 |
RUN bash -c 'shopt -s nullglob; for p in /root/patches/*.patch /root/patches/*.diff; do pwd && git apply "$p"; done' |
| 107 |
|
| 108 |
RUN make -s binaries |
| 109 |
|
| 110 |
RUN tools/package_bin.sh |
| 111 |
|
| 112 |
RUN ["/bin/bash"] |