### 下载好官方的ubuntu的镜像


https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/

改用清华的源,否则太慢了


apt update


### 安装l


dpkg -i xxxx.deb


### 解决错误


* 缺少 libappindicator3包


https://github.com/dev47apps/droidcam/issues/182

apt install libappindicator3-1


* 缺少 libpcap.so.0.8 包


apt install libpcap0.8


### Dockerfile 参考


FROM ubuntu:20.10

MAINTAINER Richard Yu <xiaoqingfengatgm@gmail.com>

# https://github.com/xiaoqingfengATGH/lantern

# lastest lantern version: 6.7.1

WORKDIR /root

RUN apt-get update  && \

         apt-get -y install wget libappindicator3-1 libpcap0.8:amd64 && \

 wget -O lantern.deb https://raw.githubusercontent.com/getlantern/lantern-binaries/master/lantern-installer-64-bit.deb?ver=6.7.1 && \

 wget -O settings.yaml https://raw.githubusercontent.com/xiaoqingfengATGH/lantern/master/settings.yaml?ver=6.7.1 && \

         dpkg -i lantern.deb && \

         rm -rf lantern.deb && \

         apt-get -f install && \

         apt-get clean && \

         rm -rf /var/cache/apt/* /var/lib/apt/lists/* && \

         mkdir /root/.lantern && \

         mv settings.yaml /root/.lantern/settings.yaml


EXPOSE 3128/tcp 8080/tcp 3129/tcp


ENTRYPOINT ["/usr/bin/lantern", "--configdir=/root/.lantern", "--headless=true"]


### settings.yaml 参考


addr: '0.0.0.0:3128'

autoLaunch: false

autoReport: true

lang: "zh-CN"

localHTTPToken: lantern

pacURL: ""

proxyAll: true

socksAddr: '0.0.0.0:3129'

systemProxy: false

uiAddr: 0.0.0.0:8080




### 错误 Unable to round-trip http request to upstream: EOF


这个主要是上面某个localHTTPToken: lantern


把这个开关弄上去就行了

-no-ui-http-token


### 最后就是在UI界面上授权设备了,这一步也简单


### 然后是把镜像上的这东西自启动起来


https://github.com/EasyPi/docker-lantern-arm/blob/master/build.sh


参考这一位的


cat > /lib/systemd/system/lantern.service <<_EOF_

[Unit]

Description=Open Internet for Everyone

Documentation=https://getlantern.org

After=network.target

[Service]

ExecStart=/root/lantern/start.sh

StandardOutput=null

StandardError=null

Restart=always

[Install]

WantedBy=multi-user.target

_EOF_


试图启动:


systemctl start lantern.service



root@ubuntu1:/lib/systemd/system# systemctl start lantern.service

System has not been booted with systemd as init system (PID 1). Can't operate.

Failed to connect to bus: Host is down

root@ubuntu1:/lib/systemd/system#


报错


sudo apt install systemctl


安装一下就解决了



systemctl status lantern.service


打开开机自启动


systemctl enable lantern.service