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

node docker update #12

Merged
merged 1 commit into from May 21, 2017

Conversation

Projects
None yet
3 participants
@Goodsmileduck
Copy link
Contributor

commented May 20, 2017

No description provided.

@Waldz
Copy link
Member

left a comment

+1


# Install packages
RUN apt-get update \
&& dpkg --install /tmp/mysterium-node.deb
&& apt-get install --fix-broken \
&& apt install -y wget openvpn iptables\

This comment has been minimized.

Copy link
@Waldz

Waldz May 20, 2017

Member

I would remove: "openvpn iptables", they are required in .deb package with more exact version

This comment has been minimized.

Copy link
@Goodsmileduck

Goodsmileduck May 20, 2017

Author Contributor

build not working without it, don't know why. but that probably about ubuntu version

This comment has been minimized.

Copy link
@Goodsmileduck

Goodsmileduck May 20, 2017

Author Contributor

I have checked it again, dpkg didn't install dependecies and give a error, so build will be failed.
Other way to use apt-get directly

RUN apt-get update \
    && apt install -y wget\
    && wget https://github.com/MysteriumNetwork/node/releases/download/${VERSION}/mysterium-node_linux_amd64.deb \
    && apt-get install -y ./mysterium-node_linux_amd64.deb \
    && rm -rf /var/cache/apk/* \
    && rm mysterium-node_linux_amd64.deb
ARG PACKAGE_FILE
COPY $PACKAGE_FILE /tmp/mysterium-node.deb
ENV VERSION 0.0.6
ENV NODE 321

This comment has been minimized.

Copy link
@Waldz

Waldz May 20, 2017

Member

Not good hardcoding NODE key, it should be injected with container environment variables

This comment has been minimized.

Copy link
@Goodsmileduck

Goodsmileduck May 20, 2017

Author Contributor

yes, you should, that just a example. there env in docker-compose.yml

#!/bin/bash
set -e

mkdir -p /dev/net

This comment has been minimized.

Copy link
@Waldz

Waldz May 20, 2017

Member

Can this be done In Dockerfile, not during startup?

This comment has been minimized.

Copy link
@ewrogers

ewrogers May 20, 2017

Yes, seems you can add

# Create OpenVPN tunnel device
RUN set -e \
    && mkdir -p /dev/net \
    && mknod /dev/net/tun c 10 200 \
    && chmod 600 /dev/net/tun

This comment has been minimized.

Copy link
@Goodsmileduck

Goodsmileduck May 20, 2017

Author Contributor

I have tested it, it didn't works. Sorry, I know less about mknod. entrypoint way is not a hack, I would recommend it. Later you can preheat some other stuff in this script.
Found it there https://github.com/kylemanna/docker-openvpn/blob/master/bin/ovpn_run

ENTRYPOINT ["/entrypoint-node.sh"]

CMD mysterium_server --config-dir=/etc/mysterium-node --node=${NODE} --runtime-dir=/tmp

This comment has been minimized.

Copy link
@Waldz

Waldz May 20, 2017

Member

Exact starting command should be like this:

sudo /usr/bin/mysterium_server --node=NODE_KEY --config-dir=/etc/mysterium-node --runtime-dir=/var/run/mysterium-node

This comment has been minimized.

Copy link
@Goodsmileduck

Goodsmileduck May 20, 2017

Author Contributor

so you need add RUN step to create /var/run/mysterium-node

RUN mkdir /var/run/mysterium-node

This comment has been minimized.

Copy link
@Waldz

Waldz May 21, 2017

Member

No, .deb package does it

@Waldz Waldz referenced this pull request May 20, 2017

Closed

Fix syntax error in Dockerfile #9

@@ -1,15 +1,21 @@
FROM ubuntu:latest

This comment has been minimized.

Copy link
@ewrogers

ewrogers May 20, 2017

FROM debian:jessie-slim yields a smaller container size.

@@ -6,12 +6,16 @@ services:
context: .
dockerfile: Dockerfile-mysterium-node
container_name: mysterium-node
cap_add:
- NET_ADMIN

This comment has been minimized.

Copy link
@ewrogers

ewrogers May 20, 2017

I haven't had luck with --cap-add=NET_ADMIN. I needed to use --privileged for IP forwarding to work on Docker 1.12.

This comment has been minimized.

Copy link
@Goodsmileduck

Goodsmileduck May 20, 2017

Author Contributor

privileged is not good approach, would recommend it for debug. it also didn't work for me if I create tun in RUN step on build, with entrypoint it works.

@Waldz Waldz changed the base branch from master to feature/node-with-docker May 21, 2017

@Waldz Waldz merged commit d594404 into mysteriumnetwork:feature/node-with-docker May 21, 2017

@Waldz
Copy link
Member

left a comment

Guys thanks for contributing.

Docker was published at: https://hub.docker.com/r/mysteriumnetwork/mysterium-node/
Usage:

docker run --cap-add NET_ADMIN --network host --publish "1194:1194" -e "NODE=123456" --name mysterium-node -d mysteriumnetwork/mysterium-node:latest
docker logs -f mysterium-node
ENTRYPOINT ["/entrypoint-node.sh"]

CMD mysterium_server --config-dir=/etc/mysterium-node --node=${NODE} --runtime-dir=/tmp

This comment has been minimized.

Copy link
@Waldz

Waldz May 21, 2017

Member

No, .deb package does it

@zolia zolia referenced this pull request May 3, 2019

Closed

Smart Contract - Metatask #1018

9 of 13 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.