Use prebuilt Docker image for mega-sdk

Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
lzzy12 2020-06-05 12:53:17 +05:30
parent 4754fb7a23
commit 8b3805c55a
2 changed files with 7 additions and 22 deletions

View File

@ -1,25 +1,10 @@
FROM ubuntu:18.04
FROM lzzy12/mega-sdk-python:latest
WORKDIR /usr/src/app
RUN chmod 777 /usr/src/app
RUN apt-get -qq update
RUN apt-get -qq install -y python3 python3-pip rar unzip git aria2 g++ gcc autoconf automake \
m4 libtool qt4-qmake make libqt4-dev libcurl4-openssl-dev \
libcrypto++-dev libsqlite3-dev libc-ares-dev \
libsodium-dev libnautilus-extension-dev \
libssl-dev libfreeimage-dev swig curl pv jq ffmpeg locales python3-lxml
# Installing mega sdk python binding
ENV MEGA_SDK_VERSION '3.6.4'
RUN git clone https://github.com/meganz/sdk.git sdk
WORKDIR sdk
RUN git checkout v$MEGA_SDK_VERSION && ./autogen.sh && \
./configure --disable-silent-rules --enable-python --disable-examples && \
make -j$(nproc --all) && cd bindings/python/ && \
python setup.py bdist_wheel && cd dist/ && \
pip install --no-cache-dir megasdk-$MEGA_SDK_VERSION-*.whl
RUN apt-get -qq install -y p7zip-full aria2 curl pv jq ffmpeg locales python3-lxml
COPY requirements.txt .
COPY extract /usr/local/bin

10
extract
View File

@ -7,7 +7,7 @@ fi
extract () {
arg="$1"
cd $(dirname "$arg")
cd "$(dirname "$arg")" || exit
case "$arg" in
*.tar.bz2)
tar xjf "$arg" --one-top-level ;;
@ -20,15 +20,15 @@ extract () {
*.tgz) tar xzf "$arg" --one-top-level ;;
*.zip)
a_dir=`expr "$arg" : '\(.*\).zip'`
unzip "$arg" -d "$a_dir" ;;
7z "$arg" -o"$a_dir" ;;
*.Z) uncompress "$arg" ;;
*.rar)
*.rar)
a_dir=`expr "$arg" : '\(.*\).rar'` ;
mkdir "$a_dir" ;
rar x "$arg" "$a_dir" ;; # 'rar' must to be installed
7z x "$arg" -o"$a_dir" ;;
*) echo "'$arg' cannot be extracted via extract()" ;;
esac
cd -
cd - || exit
}
extract "$1"