preface

If you’ve ever used Ubuntu, you know how unfriendly it can be for daily chat. The official Linux version of QQ only has the chat function of the 90’s. At the very least, the fun is gone and the user experience is terrible! Wechat can only use web version, decisive can not endure. Then I finally found a way to use the Windows version, but also through Docker boot, no impact on the system environment, I want to have both, ha ha ha!

Install the Docker environment

Official one key installation method (know you are lazy, directly to you posted out) :

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
Copy the code

Curl curl curl curl curl curl curl curl curl curl curl

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
Copy the code

If you’re not familiar with Docker, check out the previous article to learn the basics: The neglected back-end development artifact — Docker

Pull QQ, wechat mirror

Configure the environment

To allow all users to access X11 services, run the following command:

xhost +
Copy the code

Docker: Unknown Server OS: docker: Unknown Server OS: Error message: sudo chmod 666 /var/run/docker.sock

Pull to generate QQ container

1. Docker-compose mode

version: '2'
services:
  qq:
    image: bestwu/qq:office
    container_name: qq
    ipc: host
    devices:
      - /dev/snd # voice
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
      - /home/peter/TencentFiles:/TencentFiles Use your own user path
    environment:
      - DISPLAY=unix$DISPLAY
      - XMODIFIERS=@im=fcitx Chinese input, here according to the system input method type, the default is IBus
      - QT_IM_MODULE=fcitx
      - GTK_IM_MODULE=fcitx
      - AUDIO_GID=63 # Optional default 63 (Fedora) Host Audio GID resolves sound device access issues
      - GID=$GID # Optional default 1000 Current host user GID Address mount directory access permissions
      - UID=$UID # optional default 1000 host current user uid Resolve mount directory access permission issue
Copy the code

2. Docker Run

docker run -d --name qq \
    --device /dev/snd --ipc="host"\
    -v $HOME/TencentFiles:/TencentFiles \
	-v /tmp/.X11-unix:/tmp/.X11-unix \
    -e XMODIFIERS=@im=fcitx \
    -e QT_IM_MODULE=fcitx \
    -e GTK_IM_MODULE=fcitx \
    -e DISPLAY=unix$DISPLAY \
    -e AUDIO_GID=`getent group audio | cut -d: -f3` \
    -e VIDEO_GID=`getent group video | cut -d: -f3` \
    -e GID=`id -g` \
    -e UID=`id -u` \
    bestwu/qq:im
Copy the code

Pull to generate wechat container

1. Docker-compose mode

version: '2'
services:
  wechat:
    image: bestwu/wechat
    container_name: wechat
    ipc: host
    devices:
      - /dev/snd
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
      - /home/peter/WeChatFiles:/WeChatFiles Use your own user directory
    environment:
      - DISPLAY=unix$DISPLAY
      - QT_IM_MODULE=fcitx Chinese input, here according to the system input method type, the default is IBus
      - XMODIFIERS=@im=fcitx
      - GTK_IM_MODULE=fcitx
      - AUDIO_GID=63 # Optional default 63 (Fedora) Host Audio GID resolves sound device access issues
      - GID=1000 # Optional default 1000 Current host user GID Address mount directory access permissions
      - UID=1000 # optional default 1000 host current user uid Resolve mount directory access permission issue
Copy the code

2. Docker Run

docker run -d --name wechat --device /dev/snd --ipc="host"\
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -v $HOME/WeChatFiles:/WeChatFiles \
    -e DISPLAY=unix$DISPLAY \
    -e XMODIFIERS=@im=fcitx \
    -e QT_IM_MODULE=fcitx \
    -e GTK_IM_MODULE=fcitx \
    -e AUDIO_GID=`getent group audio | cut -d: -f3` \
    -e GID=`id -g` \
    -e UID=`id -u` \
    bestwu/wechat
Copy the code

Common commands

Docker containers can now be manipulated by their names:

# start docker start QQ (wechat) # Stop docker stop QQ (wechat) # restart docker qq(wechat)Copy the code

conclusion

GitHub Address: wechat: github.com/bestwu/dock… QQ:github.com/bestwu/dock…

The real encounter can not solve the problem to the developer side to do things, I just nature porter ~~~

You don’t have to use Ubuntu for your work, and who would do that? You still have to paddle and cherish it.