Docker Community Forums

Share and learn in the Docker community.

Cannot Input Chinese in Docker Qt Program


(Cyc610) #1

I build a qt program using linuxdeployqt and deploy it to docker.
After copying file platforminputcontexts/libibusplatforminputcontextplugin.so to the plugins directory, I can make sure that the qt program can run and input chinese in any other ubuntu16.04 machine without qt installed.
input method: ibus-pinyin
Then I build a docker image based ubuntu:latest
################################################
FROM ubuntu:latest
RUN apt-get update
&& apt-get install -y libexpat1 libxcb1 libxcb-dri3-0 libx11-6 libx11-xcb1 libxcb-present0 libxcb-sync1 libxshmfence1 libglapi-mesa
libxext6 libxdamage1 libxfixes3 libxcb-glx0 libxcb-dri2-0 libxxf86vm1 libdrm2 libdbus-1-3 libfontconfig1 libice6 libxi6 libsm6 libxkbcommon0 fonts-wqy-zenhei
CMD ["/bin/bash"]
################################################
Then I run the image with the following command in ubuntu 16.04:
docker run -it --rm -e DISPLAY=unix$DISPLAY -e LANG=C.UTF-8 -v /data/soft:/soft -v /tmp/.X11-unix:/tmp/.X11-unix ubuntu:Qt /bin/bash
I can input chinese in the bash, but when I start my qt program , I can not input chinese in the qt window.
Can any one give me any helps. thanks.