Giter Site home page Giter Site logo

docker_ttnode's Introduction

甜糖星愿镜像

  • 基于debian:stable-slim构建
  • 去除了crontab任务,改用脚本监控ttndoe进程
  • docker日志中直接查询UID
  • docker日志中直接查看UPNP端口号
  • 完全开源

食用方法

如果是arm架构(例如N1盒子),可直接使用,如果是x86平台,是不支持arm架构镜像,因此我们可以运行一个新的容器让其支持该特性。

docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

方法一

打开混杂(这步可以省略,如果不能正常工作再打开)

ip link set eth0 promisc on

创建网络(自行替换网关以及网段)

docker network create -d macvlan --subnet=192.168.2.0/24 --gateway=192.168.2.88 -o parent=eth0 -o macvlan_mode=bridge macnet

运行容器(自行替换路径、IP以及可选替换dns)

docker run -itd \
  -v /mnt/data/ttnode:/mnts \
  --name ttnode \
  --net=macnet --ip=192.168.2.2 --dns=114.114.114.114 --mac-address C2:F2:9C:C5:B2:94 \
  --privileged=true \
  --restart=always \
  ericwang2006/ttnode

方法二: 直接主网络运行(替换路径)

docker run -itd \
  -v /mnt/data/ttnode:/mnts \
  --name ttnode \
  --net=host \
  --privileged=true \
  --restart=always \
  ericwang2006/ttnode

方法三: docker-compose

version: '2'

services:     
  ttnode:
    image: ericwang2006/ttnode
    container_name: ttnode
    privileged: true
    restart: always
    mac_address: C2:F2:9C:C5:B2:94
    dns: 114.114.114.114
    networks: 
      macvlan:
        ipv4_address: 192.168.2.2
    volumes:
      - /mnt/data/ttnode:/mnts

networks:
  macvlan:
    driver: macvlan
    driver_opts:
      parent: eth0
    ipam:
      config:
        - subnet: 192.168.2.0/24
          gateway: 192.168.2.1

进入容器:

docker attach ttnode
or
docker exec -it ttnode /bin/bash 

查询UUID:

./usr/node/ttnode -p /mnts
or
#容器外执行
docker logs ttnode

已知问题

  • 日志中会提示cannot create /proc/sys/net/core/wmem_max: Directory nonexistent,是因为在daocker中不能设置Linux内核参数,不影响使用
  • docker中ttnode第一次启动后大约20秒后有自动退出的概率,不用理会,脚本会再次启动ttnode(这是由于ttnode自动升级导致的)
[2020-11-18 10:25:12] ttnode进程不存在,启动ttnode,
/bin/sh: 1: cannot create /proc/sys/net/core/wmem_max: Directory nonexistent,
如果不能自动发现设备,请将此UID e1c8191de1e1e16a67e05ab3d7bc86ba 生成二维码并用甜糖客户端扫描添加,
[2020-11-18 10:25:34] ttnode启动失败,再来一次,
/bin/sh: 1: cannot create /proc/sys/net/core/wmem_max: Directory nonexistent,

如果觉得还有点用,麻烦用一下我的邀请码631441,有加成卡15张,我也有推广收入

docker_ttnode's People

Contributors

ericwang2006 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.