Install with Docker

Installation with Docker

📘

Prerequisites

To run an installation with Docker, you must have it installed.

Docker installation: https://docs.docker.com/engine/install/


Mandatory Variables

In order to successfully install Syntropy with Docker, you must have an API Key

Variable Name

Description

SYNTROPY_API_KEY

SYNTROPY Network Agent Token (String)

👍

API Key Example

SYNTROPY_API_KEY=nQlSAezB8yxncfdeW#$2mKR4UTqEQ2R5



Install with Docker

The easiest way to start with Syntropy Platform is to install Syntropy Agent with Docker:

// Syntropy API Key is Required

sudo docker run --network="host" --restart=on-failure:10 \
--cap-add=NET_ADMIN \
--cap-add=SYS_MODULE -v /var/run/docker.sock:/var/run/docker.sock:ro \
--device /dev/net/tun:/dev/net/tun --name=syntropy-agent \
-e SYNTROPY_NETWORK_API='docker' \
-e SYNTROPY_AGENT_TOKEN=<<agent_token>> -d syntropynet/agent:stable
FROM golang:1.14.1-alpine3.11 as builder

RUN apk add --update git build-base libmnl-dev iptables

RUN git clone https://git.zx2c4.com/wireguard-go && \
    cd wireguard-go && \
    make && \
    make install

ENV WITH_WGQUICK=yes
RUN git clone https://git.zx2c4.com/wireguard-tools && \
    cd wireguard-tools && \
    cd src && \
    make && \
    make install

FROM python:alpine3.10
COPY --from=builder /usr/bin/wireguard-go /usr/bin/wg* /usr/bin/
COPY . /agent
WORKDIR ./agent
RUN apk add wireguard-tools iproute2 \
  && apk --update add python py-pip openssl ca-certificates py-openssl wget \
  && apk --update add --virtual build-dependencies libffi-dev openssl-dev python-dev py-pip build-base \
  && pip install --upgrade pip \
  && python setup.py install \
  && rm -rf /agent \
  && apk del build-dependencies

ENTRYPOINT ["/usr/local/bin/noia_agent", "run"]
docker run --network="host" --restart=on-failure:10 --cap-add=NET_ADMIN \
   --cap-add=SYS_MODULE -v /var/run/docker.sock:/var/run/docker.sock:ro \
   --device /dev/net/tun:/dev/net/tun --name=syntropynet-agent \
   -e SYNTROPY_AGENT_TOKEN=<<agent_token>> \
   -e SYNTROPY_NETWORK_API='host' \
   -e SYNTROPY_ALLOWED_IPS='[{"0.0.0.0/0":"internet"}]' \
   -e SYNTROPY_SERVICES_STATUS=true \
   -e SYNTROPY_TAGS=VPN -d syntropynet/agent:stable

Install with docker-compose

If you have multiple containers you are configuring for, you are able to use docker-compose for installation as well.

# Syntropy API Key is Required

version: '2'

services:
  syntropy-agent:
    image: syntropynet/agent:stable
    container_name: syntropy-agent
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    environment:
      - SYNTROPY_AGENT_TOKEN=<<agent_token>>
      - SYNTROPY_NETWORK_API=docker
    restart: always
    network_mode: "host"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    devices:
      - "/dev/net/tun:/dev/net/tun"
FROM golang:1.14.1-alpine3.11 as builder

RUN apk add --update git build-base libmnl-dev iptables

RUN git clone https://git.zx2c4.com/wireguard-go && \
    cd wireguard-go && \
    make && \
    make install

ENV WITH_WGQUICK=yes
RUN git clone https://git.zx2c4.com/wireguard-tools && \
    cd wireguard-tools && \
    cd src && \
    make && \
    make install

FROM python:alpine3.10
COPY --from=builder /usr/bin/wireguard-go /usr/bin/wg* /usr/bin/
COPY . /agent
WORKDIR ./agent
RUN apk add wireguard-tools iproute2 \
  && apk --update add python py-pip openssl ca-certificates py-openssl wget \
  && apk --update add --virtual build-dependencies libffi-dev openssl-dev python-dev py-pip build-base \
  && pip install --upgrade pip \
  && python setup.py install \
  && rm -rf /agent \
  && apk del build-dependencies

ENTRYPOINT ["/usr/local/bin/noia_agent", "run"]

Run Docker Container

  • Start SYNTROPY Agent container in the background:
sudo docker-compose up -d

Next step

Customize your installation with Syntropy Agent Variables

Did this page help you?