From c238d64ca64c59156c83a43bee0260b737f9e183 Mon Sep 17 00:00:00 2001 From: Fmstrat Date: Tue, 1 Mar 2022 16:58:04 -0500 Subject: [PATCH] Add Docker support --- Dockerfile | 27 +++++++++++++++++++++++++++ README.md | 7 +++++++ 2 files changed, 34 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..267df7c3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM ubuntu:20.04 + +ENV DEBIAN_FRONTEND noninteractive + +WORKDIR / + +RUN \ + apt-get update &&\ + apt-get install -y autoconf libtool g++ libcrypto++-dev libz-dev libsqlite3-dev libssl-dev \ + libcurl4-gnutls-dev libreadline-dev libpcre++-dev libsodium-dev libc-ares-dev \ + libfreeimage-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev \ + libmediainfo-dev libzen-dev libuv1-dev git make &&\ + apt-get clean &&\ + rm -rf /var/lib/apt/lists/* + +COPY . /MEGAcmd/ + +RUN \ + cd MEGAcmd &&\ + git submodule update --init --recursive &&\ + sh autogen.sh &&\ + ./configure --disable-dependency-tracking &&\ + make &&\ + make install &&\ + ldconfig + + diff --git a/README.md b/README.md index 276538ae..98a04ff2 100644 --- a/README.md +++ b/README.md @@ -232,6 +232,13 @@ source /Applications/MEGAcmd.app/Contents/MacOS/megacmd_completion.sh ## NAS systems Currently we have build scripts for **Synology** and **QNAP**, which can be found in the `build/` folder along with instructions on how to set up the build. Typically this results in a 'package' which can then be manually installed in the NAS. To use MEGAcmd on those systems, ssh into the device and run the commands as normal (having first added their folder to your `PATH` variable). +## Docker +There is an included `Dockerfile` that can be used to build and run MEGAcmd. It can be used with the following syntax: +``` +docker build -t megacmd . +docker run --rm -ti -v ${HOME}/.megaCmd:/root/.megaCmd -v /path/to/download:/download megacmd mega-get "https://mega.nz/folder/" /download/ +``` + *Important note for MacOS Catalina or above: since Catalina, MacOS uses `zsh` as default shell. If you want to have auto completion, we strongly recommend you to use `bash` shell (just execute `bash` in your terminal). # Features: