Skip to content

Commit

Permalink
Migrated docker file to alpine linux
Browse files Browse the repository at this point in the history
  • Loading branch information
wargio committed Apr 25, 2021
1 parent 8b9c308 commit 11ae8a4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 32 deletions.
42 changes: 11 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,46 +1,26 @@
## fufluns - Copyright 2019-2021 - deroad

FROM archlinux/base:latest

RUN pacman -Suuyy --noconfirm python-pip wget tar unzip base-devel git meson ninja

RUN mkdir -p /fufluns /tmp-build || sleep 0
FROM alpine:edge

WORKDIR /
RUN apk add --update py-pip wget curl tar unzip xz git bash openjdk11 android-tools alpine-sdk python3-dev
RUN mkdir -p /fufluns || sleep 0
RUN pip install tornado rzpipe wheel apkid

WORKDIR /tmp-build

RUN chmod 777 /tmp-build

RUN cp /etc/sudoers /etc/sudoers.back || sleep 0
RUN wget -q https://github.com/rizinorg/rizin/releases/download/v0.2.1/rizin-v0.2.1-static-x86_64.tar.xz -O rizin.tar.xz && tar -xvkf rizin.tar.xz && rm -rf rizin.tar.xz

RUN pip wheel --wheel-dir=/tmp-build/yara-python --build-option="build" --build-option="--enable-dex" git+https://github.com/VirusTotal/[email protected] && \
pip uninstall -y yara-python && \
pip install --no-index --find-links=/tmp-build/yara-python yara-python

RUN useradd builduser -m && passwd -d builduser && printf 'builduser ALL=(ALL) ALL\n' | tee -a /etc/sudoers

RUN git clone --depth=1 https://github.com/rizinorg/rizin rizin-master && chown -R builduser:builduser rizin-master
RUN su builduser -c 'cd /tmp-build/rizin-master && meson --prefix=/usr build && meson subprojects update && ninja -C build'
RUN cd /tmp-build/rizin-master && sudo ninja -C build install && cd - && sudo rm -rf rizin-master
WORKDIR /usr/local/bin
RUN curl -sLO https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool && chmod +x apktool
RUN curl -sL -o apktool.jar https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.5.0.jar && chmod +x apktool.jar

RUN wget -q https://aur.archlinux.org/cgit/aur.git/snapshot/android-apktool.tar.gz && chmod 666 *.tar.gz
RUN su builduser -c 'cd /tmp-build && tar -xvf android-apktool.tar.gz && cd android-apktool && makepkg -s --noconfirm'
RUN cd /tmp-build/android-apktool && pacman -U --noconfirm *.xz && cd - && rm -rf *.tar.gz android-apktool

RUN wget -q https://aur.archlinux.org/cgit/aur.git/snapshot/android-sdk-platform-tools.tar.gz && chmod 666 *.tar.gz
RUN su builduser -c 'cd /tmp-build && tar -xvf android-sdk-platform-tools.tar.gz && cd android-sdk-platform-tools && makepkg -s --noconfirm'
RUN cd /tmp-build/android-sdk-platform-tools && pacman -U --noconfirm *.xz && cd - && rm -rf *.tar.gz android-sdk-platform-tools

## cleaning
RUN userdel builduser && mv /etc/sudoers.back /etc/sudoers || sleep 0
RUN apk del alpine-sdk python3-dev wget tar git curl xz

## copying fufluns
WORKDIR /

RUN rm -rf /tmp-build


## copying fufluns
COPY ./www/ /fufluns/www
COPY ./android/ /fufluns/android
COPY ./ios/ /fufluns/ios
Expand All @@ -51,7 +31,7 @@ COPY ./LICENSE /fufluns/
RUN chmod +x /fufluns/*.sh

## creating the user and setting cmd.
RUN useradd user -m && passwd -d user
RUN adduser -D user

EXPOSE 8080/tcp

Expand Down
2 changes: 1 addition & 1 deletion fufluns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

SCRIPTPATH="$(cd "$(dirname "$0")"; pwd -P)"

python "$SCRIPTPATH/main.py" $@
python3 "$SCRIPTPATH/main.py" $@

0 comments on commit 11ae8a4

Please sign in to comment.