碧纱笼 發表於 2021-12-30 18:10:00

debian系统安装微信和企业微信

<h3>1、安装docker</h3>
<p>卸载旧版本</p>
<div class="cnblogs_code">
<pre>sudo apt-<span style="color: rgba(0, 0, 255, 1)">get</span> remove docker docker-engine docker.io containerd runc</pre>
</div>
<p>&nbsp;</p>
<p>更新apt源</p>
<div class="cnblogs_code">
<pre>sudo apt update</pre>
</div>
<p>安装 apt 依赖包,用于通过 HTTPS 来获取仓库</p>
<div class="cnblogs_code">
<pre>sudo apt-<span style="color: rgba(0, 0, 255, 1)">get</span><span style="color: rgba(0, 0, 0, 1)"> install \
    apt</span>-transport-<span style="color: rgba(0, 0, 0, 1)">https \
    ca</span>-<span style="color: rgba(0, 0, 0, 1)">certificates \
    curl \
    gnupg2 \
    software</span>-properties-common</pre>
</div>
<p>添加 Docker 的官方 GPG 密钥:</p>
<div class="cnblogs_code">
<pre>curl -fsSL https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/docker-ce/linux/debian/gpg | sudo apt-key add -</span></pre>
</div>
<p>9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 通过搜索指纹的后8个字符,验证您现在是否拥有带有指纹的密钥</p>
<div class="cnblogs_code">
<pre>sudo apt-<span style="color: rgba(0, 0, 0, 1)">key fingerprint 0EBFCD88<br></span></pre>
</div>
<p>使用以下指令设置稳定版仓库:</p>
<div class="cnblogs_code">
<pre>sudo add-apt-<span style="color: rgba(0, 0, 0, 1)">repository \
   </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">deb https://mirrors.ustc.edu.cn/docker-ce/linux/debian \</span>
$(lsb_release -<span style="color: rgba(0, 0, 0, 1)">cs) \
stable</span><span style="color: rgba(128, 0, 0, 1)">"</span></pre>
</div>
<p>更新 apt 包索引:</p>
<div class="cnblogs_code">
<pre>sudo apt update</pre>
</div>
<p>安装最新版本的 Docker Engine-Community 和 containerd ,或者转到下一步安装特定版本:</p>
<div class="cnblogs_code">
<pre>sudo apt-<span style="color: rgba(0, 0, 255, 1)">get</span> install docker-ce docker-ce-cli containerd.io</pre>
</div>
<p>要安装特定版本的 Docker Engine-Community,请在仓库中列出可用版本,然后选择一种安装。列出您的仓库中可用的版本:</p>
<div class="cnblogs_code">
<pre>$ apt-cache madison docker-<span style="color: rgba(0, 0, 0, 1)">ce

docker</span>-ce | <span style="color: rgba(128, 0, 128, 1)">5</span>:<span style="color: rgba(128, 0, 128, 1)">18.09</span>.<span style="color: rgba(128, 0, 128, 1)">1</span>~<span style="color: rgba(128, 0, 128, 1)">3</span>-<span style="color: rgba(128, 0, 128, 1)">0</span>~debian-stretch | https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/docker-ce/linux/debian stretch/stable amd64 Packages</span>
docker-ce | <span style="color: rgba(128, 0, 128, 1)">5</span>:<span style="color: rgba(128, 0, 128, 1)">18.09</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>~<span style="color: rgba(128, 0, 128, 1)">3</span>-<span style="color: rgba(128, 0, 128, 1)">0</span>~debian-stretch | https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/docker-ce/linux/debian stretch/stable amd64 Packages</span>
docker-ce | <span style="color: rgba(128, 0, 128, 1)">18.06</span>.<span style="color: rgba(128, 0, 128, 1)">1</span>~ce~<span style="color: rgba(128, 0, 128, 1)">3</span>-<span style="color: rgba(128, 0, 128, 1)">0</span>~debian      | https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/docker-ce/linux/debian stretch/stable amd64 Packages</span>
docker-ce | <span style="color: rgba(128, 0, 128, 1)">18.06</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>~ce~<span style="color: rgba(128, 0, 128, 1)">3</span>-<span style="color: rgba(128, 0, 128, 1)">0</span>~debian      | https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/docker-ce/linux/debian stretch/stable amd64 Packages</span>
...</pre>
</div>
<p>使用第二列中的版本字符串安装特定版本,例如 5:18.09.1~3-0~debian-stretch 。</p>
<div class="cnblogs_code">
<pre>sudo apt-<span style="color: rgba(0, 0, 255, 1)">get</span> install docker-ce=&lt;VERSION_STRING&gt; docker-ce-cli=&lt;VERSION_STRING&gt; containerd.io</pre>
</div>
<p>测试 Docker 是否安装成功,输入以下指令,打印出以下信息则安装成功:</p>
<div class="cnblogs_code">
<pre>$ sudo docker run hello-<span style="color: rgba(0, 0, 0, 1)">world

Unable to find image </span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">hello-world:latest</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)"> locally
latest: Pulling </span><span style="color: rgba(0, 0, 255, 1)">from</span> library/hello-<span style="color: rgba(0, 0, 0, 1)">world
1b930d010525: Pull complete                                                                                                                                  Digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f
Status: Downloaded newer image </span><span style="color: rgba(0, 0, 255, 1)">for</span> hello-<span style="color: rgba(0, 0, 0, 1)">world:latest


Hello </span><span style="color: rgba(0, 0, 255, 1)">from</span> Docker!<span style="color: rgba(0, 0, 0, 1)">
This message shows that your installation appears to be working correctly.


To generate </span><span style="color: rgba(0, 0, 255, 1)">this</span><span style="color: rgba(0, 0, 0, 1)"> message, Docker took the following steps:
</span><span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)">. The Docker client contacted the Docker daemon.
</span><span style="color: rgba(128, 0, 128, 1)">2</span>. The Docker daemon pulled the <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">hello-world</span><span style="color: rgba(128, 0, 0, 1)">"</span> image <span style="color: rgba(0, 0, 255, 1)">from</span><span style="color: rgba(0, 0, 0, 1)"> the Docker Hub.
    (amd64)
</span><span style="color: rgba(128, 0, 128, 1)">3</span>. The Docker daemon created a <span style="color: rgba(0, 0, 255, 1)">new</span> container <span style="color: rgba(0, 0, 255, 1)">from</span><span style="color: rgba(0, 0, 0, 1)"> that image which runs the
    executable that produces the output you are currently reading.
</span><span style="color: rgba(128, 0, 128, 1)">4</span><span style="color: rgba(0, 0, 0, 1)">. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.


To </span><span style="color: rgba(0, 0, 255, 1)">try</span><span style="color: rgba(0, 0, 0, 1)"> something more ambitious, you can run an Ubuntu container with:
$ docker run </span>-<span style="color: rgba(0, 0, 0, 1)">it ubuntu bash


Share images, automate workflows, and more with a free Docker ID:
https:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">hub.docker.com/</span>
<span style="color: rgba(0, 0, 0, 1)">

For more examples and ideas, visit:
https:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">docs.docker.com/get-started/</span></pre>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3>2、安装微信</h3>
<p>拉取微信镜像</p>
<div class="cnblogs_code">
<pre>sudo docker pull bestwu/wechat</pre>
</div>
<p>创建运行脚本wechat.sh</p>
<div class="cnblogs_code">
<pre>sudo docker run -d --name wechat --device /dev/snd --ipc=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">host</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)"> \
</span>-v /tmp/.X11-unix:/tmp/.X11-<span style="color: rgba(0, 0, 0, 1)">unix \
</span>-v $HOME/WeChatFiles:/<span style="color: rgba(0, 0, 0, 1)">WeChatFiles \
</span>-e DISPLAY=<span style="color: rgba(0, 0, 0, 1)">unix$DISPLAY \
</span>-e XMODIFIERS=@im=<span style="color: rgba(0, 0, 0, 1)">fcitx \
</span>-e QT_IM_MODULE=<span style="color: rgba(0, 0, 0, 1)">fcitx \
</span>-e GTK_IM_MODULE=<span style="color: rgba(0, 0, 0, 1)">fcitx \
</span>-e AUDIO_GID=`getent group audio | cut -d: -<span style="color: rgba(0, 0, 0, 1)">f3` \
</span>-e GID=`id -<span style="color: rgba(0, 0, 0, 1)">g` \
</span>-e UID=`id -<span style="color: rgba(0, 0, 0, 1)">u` \
bestwu</span>/wechat</pre>
</div>
<p>使用脚本</p>
<div class="cnblogs_code">
<pre>source wechat.sh</pre>
</div>
<p>开启关闭</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)"># 开启
sudo docker start wechat

# 关闭
sudo docker stop wechat</span></pre>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="color: rgba(255, 0, 0, 1)">注意:</span>可能会有黑点,可以在微信聊天窗口数据哈哈,会有表情,然后在删掉输入内容就没了</p>
<p>&nbsp;</p>
<h3>3、安装企业微信</h3>
<p>直接编辑脚本 wework.sh</p>
<div class="cnblogs_code">
<pre>#!/bin/<span style="color: rgba(0, 0, 0, 1)">bash
NAME</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">wework</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
VOLUME_BASE</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">$HOME/docker_data/wework</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
mkdir </span>-<span style="color: rgba(0, 0, 0, 1)">p $VOLUME_BASE
docker ps </span>-q -a --filter <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">name=$NAME</span><span style="color: rgba(128, 0, 0, 1)">"</span> | xargs -I {} docker rm -<span style="color: rgba(0, 0, 0, 1)">f {}
docker run </span>-d --name $NAME --device /dev/snd --<span style="color: rgba(0, 0, 0, 1)">ipc host \
    </span>-v /tmp/.X11-unix:/tmp/.X11-<span style="color: rgba(0, 0, 0, 1)">unix \
    </span>-v $VOLUME_BASE/WXWork:/<span style="color: rgba(0, 0, 0, 1)">WXWork \
    </span>-v $HOME:/<span style="color: rgba(0, 0, 0, 1)">HostHome \
    </span>-v $VOLUME_BASE/wine-WXWork:/home/wechat/.deepinwine/Deepin-<span style="color: rgba(0, 0, 0, 1)">WXWork \
    </span>-e DISPLAY=<span style="color: rgba(0, 0, 0, 1)">unix$DISPLAY \
    </span>-e XMODIFIERS=@im=<span style="color: rgba(0, 0, 0, 1)">fcitx \
    </span>-e QT_IM_MODULE=<span style="color: rgba(0, 0, 0, 1)">fcitx \
    </span>-e GTK_IM_MODULE=<span style="color: rgba(0, 0, 0, 1)">fcitx \
    </span>-e AUDIO_GID=`getent group audio | cut -d: -<span style="color: rgba(0, 0, 0, 1)">f3` \
    </span>-e GID=`id -<span style="color: rgba(0, 0, 0, 1)">g` \
    </span>-e UID=`id -<span style="color: rgba(0, 0, 0, 1)">u` \
    </span>-e DPI=<span style="color: rgba(128, 0, 128, 1)">96</span><span style="color: rgba(0, 0, 0, 1)"> \
    </span>-e WAIT_FOR_SLEEP=<span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)"> \
    </span>--ip <span style="color: rgba(128, 0, 128, 1)">172.19</span>.<span style="color: rgba(128, 0, 128, 1)">0.2</span><span style="color: rgba(0, 0, 0, 1)"> \
    boringcat</span>/wechat:work</pre>
</div>
<p>使用脚本</p>
<div class="cnblogs_code">
<pre>source wework.sh</pre>
</div>
<p>&nbsp;</p>
<p>注意:可能会报错(没有权限)</p>
<div class="cnblogs_code">
<pre>song@song:~/<span style="color: rgba(0, 0, 0, 1)">docker$ source wework.sh
Got permission denied </span><span style="color: rgba(0, 0, 255, 1)">while</span> trying to connect to the Docker daemon socket at unix:<span style="color: rgba(128, 128, 128, 1)">///</span><span style="color: rgba(0, 128, 0, 1)">var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json?all=1&amp;filters=%7B%22name%22%3A%7B%22wework%22%3Atrue%7D%7D: dial unix /var/run/docker.sock: connect: permission denied</span>
<span style="color: rgba(0, 0, 0, 1)">docker: unknown server OS: .
See </span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">docker run --help</span><span style="color: rgba(128, 0, 0, 1)">'</span>.</pre>
</div>
<p>解决方案</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">sudo groupadd docker
sudo gpasswd </span>-<span style="color: rgba(0, 0, 0, 1)">a $USER docker
newgrp docker</span></pre>
</div>
<p>再次source脚本即可</p>
<p>&nbsp;</p><br><br>
来源:https://www.cnblogs.com/zhengsongsong/p/15749989.html
頁: [1]
查看完整版本: debian系统安装微信和企业微信