Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM ubuntu AS builder

RUN apt-get update && apt-get install -y --no-install-recommends \
autoconf \
camlp4 \
g++ \
gcc \
libbz2-dev \
libc6-dev \
libgd-gd2-noxpm-ocaml-dev \
libmagic-dev \
libminiupnpc-dev \
libnatpmp-dev \
libnum-ocaml-dev \
make \
ocaml-nox \
zlib1g-dev

WORKDIR /app
COPY . /app

RUN ./configure \
--disable-directconnect \
--disable-fasttrack \
--disable-gnutella \
--disable-gnutella2 \
--enable-batch \
--enable-upnp-natpmp \
&& make

FROM ubuntu

RUN adduser --disabled-password --gecos "" mlnet
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
libgd3 \
libmagic1 \
libminiupnpc17 \
libnatpmp1 \
&& rm -rf /var/lib/apt/lists/*

COPY --from=builder /app/mlnet /usr/bin/

USER mlnet
ENTRYPOINT ["/usr/bin/mlnet"]
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,22 @@

![Build](https://github.com/ygrek/mldonkey/workflows/Build/badge.svg?branch=master)

## Use with Docker

To create a docker image with the latest version for your platform (tested with `amd64` and `aarch64`), checkout this git repo and run:


```
docker build -t mldonkey:latest .
```

To run the container with docker-compose, edit the docker-compose.yml file to match your network and storage settings. Then run:

```
docker-compose up
```

Make sure the user id 1000 has write access to the volume mount point (`/srv/mlnet` in this example).


http://mldonkey.sourceforge.net
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.3'

services:
mldonkey:
image: mldonkey
command: "--ED2K-port 4662 --BT-dht_port 3615"
container_name: mldonkey
restart: unless-stopped
ports:
- "4000:4000" # Telnet
- "4001:4001" # GUI
- "4080:4080" # Web GUI
- "3615:3615/udp" # BitTorrent DHT
- "4662:4662" # eDonkey TCP
- "4666:4666/udp" # eDonkey UDP (TCP+4)
- "6881:6881" # BitTorrent
- "6882:6882" # BitTorrent
volumes:
- "/srv/mlnet:/home/mlnet/.mldonkey"