mysteriumnetwork / node

Mysterium Network Node - official implementation of distributed VPN network (dVPN) protocol
https://mysterium.network
GNU General Public License v3.0
1.11k stars 311 forks source link

Docker Image for ARM64 #1538

Closed Trevor-K-Smith closed 2 years ago

Trevor-K-Smith commented 4 years ago

Can ARM64 please be supported for docker images?

This would enable us to run multiple mysterium nodes on a single RPI when we have multiple IP's available.

zolia commented 4 years ago

Hello,

currently we support only arm64 deb packages. Docker image support is not in our radar atm since demand for this is very very low. But it is very easy to build arm64 docker image. Just take some ready ubuntu / raspbian docker image and apt install our deb file with dependencies in Dockerfile.

Trevor-K-Smith commented 4 years ago

I understand, appreciate the reply.

I have put some time into trying to get it to work myself.

Below is what i attempted at my best, package installs without error and all dependencies, however, myst is returning "operation not permitted" when running.

Any quick advice would be appreciated, but i understand the no support.

FROM ubuntu:rolling

# Issues regarding resolvconf solved with https://github.com/moby/moby/issues/1297
RUN apt update \
&& apt-get -y install debconf-utils \
&& echo resolvconf resolvconf/linkify-resolvconf boolean false | debconf-set-selections \
&& apt-get -y install resolvconf \

# Run Installation Script
&& apt install curl sudo apt-utils -y \
&& sudo -E bash -c "$(curl -s https://raw.githubusercontent.com/mysteriumnetwork/node/master/install.sh)"
Trevor-K-Smith commented 4 years ago

If i can get this working were i understand, i will do my best to support it going forward

si458 commented 4 years ago

ill tag onto this, it would be amazing to have a docker arm build! because im currently running home-assistant and mysterium node at home but on 2 pi's BUT home-assistant OS actually uses docker as base, so would be amazing to move everything into one node!

arpitjindal97 commented 4 years ago

I have this same requirement, the existing docker image provided by mysterium are on xenial which points to older version of myst on ppa launchpad.

So, I created my own version of mysterium docker image supporting multiarch, that means it will work on linux/amd64 and linux/arm64. The install.sh is kinda broken.

Here are the files:

Dockerfile

FROM ubuntu:bionic

RUN apt-get update && apt-get install -y curl software-properties-common

RUN add-apt-repository -y ppa:wireguard/wireguard
RUN add-apt-repository -y ppa:mysteriumnetwork/node

RUN apt-get update && apt-get install -y ipset openvpn libcap2-bin jq 
RUN apt-get install -y wireguard wireguard-dkms tmux

RUN echo "resolvconf resolvconf/linkify-resolvconf boolean false" | debconf-set-selections
RUN apt-get install resolvconf

RUN echo "debconf mysterium/accept_terms select true" | debconf-set-selections
#RUN echo debconf mysterium/accept_terms seen true | debconf-set-selections
RUN apt-get install -y myst

RUN usermod -a -G mysterium-node root
WORKDIR /root
COPY run.sh /root
COPY db /var/lib/mysterium-node/db
COPY keystore /var/lib/mysterium-node/keystore
COPY config.toml /etc/mysterium-node/config.toml

EXPOSE 4449 40000-50000

CMD ["bash","run.sh"]

run.sh

#!/bin/bash

source /etc/default/mysterium-node
/usr/bin/myst $CONF_DIR $SCRIPT_DIR $DATA_DIR $RUN_DIR $DAEMON_OPTS service --openvpn.port 1194 --agreed-terms-and-conditions $SERVICE_OPTS

Building docker image

docker buildx build --platform linux/arm64,linux/amd64 -t arpitjindal1997/myst-multiarch:latest . --push

Running image

docker run --cap-add NET_ADMIN -p 4449:4449 -d --rm  arpitjindal1997/myst-multiarch:latest

Before building docker image you can place your node's keystore dir, db dir and config.toml. You can remove COPY lines from Dockerfile also to adjust your needs.

This is how it will look on Docker hub image

@zolia Please respond if you like the approach then I can create a PR for the same.

Suggestions are welcomed

chompomonim commented 3 years ago

@arpitjindal97 sorry for missing your message and not responding earlier. We're always very open for community contribution and would be happy to review and merge your PR.

Donatas-MN commented 2 years ago

ARM/ARM64 support for docker images was added.

Trevor-K-Smith commented 2 years ago

Sweeet, thanks bud!