我创建了一个docker图像来运行Chromium浏览器。它工作得很好,我能够找到几乎所有出现问题的解决方案。然而,终端中显示了几个错误,我似乎无法找到解决方案。
第一个错误是:
[1:1:0329/015547.694703:错误:gpu\U process\U transport\U factory.cc(1019)]丢失UI共享上下文。
另一个是:
[1:216:0329/015547.823867:错误:bus.cc(394)]无法连接到总线:无法分析服务器地址:未知地址类型(有效类型的示例为“tcp”和UNIX上的“UNIX”)
就功能而言,我还没有遇到过任何问题,但我无法处理不知道的问题。
主持人:CentOS 7
Dockerfile文件:
FROM ubuntu:16.04
COPY entrypoint.sh /sbin/entrypoint.sh
RUN chmod 755 /sbin/entrypoint.sh
ENTRYPOINT ["/sbin/entrypoint.sh"]
RUN apt-get update -y
RUN apt-get install packagekit-gtk3-module -y
RUN apt-get install libcanberra-gtk* -y
RUN apt-get install chromium-browser -y
RUN apt-get install xauth -y
RUN apt-get upgrade -y
RUN apt-get autoremove &&\
apt-get clean &&\
rm -rf /tmp
入口点脚本:
#!/bin/bash
username
and reminds the user
useradd -m ${NEW_USER}
if [[ "${?}" -ne 0 ]]
then
echo "Account already created; starting gscan2pdf container"
echo "If you have not already done so: "
echo "Please comment out the indicated section in the
'gscan2pdf_run.sh' script"
exit 0
fi
becomes reachable
matching the UID and GID in the
necessary for the method of
echo "${NEW_USER}:${NEW_USER}" | chpasswd && \
usermod --shell /bin/bash ${NEW_USER} && \
usermod -aG sudo ${NEW_USER} && \
mkdir /etc/sudoers.d && \
touch /etc/sudoers.d/${NEW_USER} && \
echo "${NEW_USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/${NEW_USER}
&& \
chmod 0440 /etc/sudoers.d/${NEW_USER} && \
usermod --uid "${NEW_UID}" ${NEW_USER} && \
groupmod --gid "${NEW_GID}" ${NEW_USER}
not present at runtime -the
before the next run
echo "Account has been created to sync acces to the host's XServer."
echo "Please comment out the indicated section in the 'run_gscan.sh'
script"
最后,用于运行容器的脚本:
matching user account in the image
HOST_UID=$(id -u)
HOST_GID=$(id -g)
XSOCK=/tmp/.X11-unix &&
XAUTH=/tmp/.docker.xauth &&
a series of piped commands
display- :0 here -of to the sed
nmerge to merge the numeric-format
will use t access the Xserver and
above; not that the entrypoint
runtime and the applcation is
docker run \
-ti \
--user $USER \
--privileged \
-v /dev/snd:/dev/snd \
-v /var/run/dbus:/var/run/dbus \
-v $XAUTH:$XAUTH -v $XSOCK:$XSOCK \
-e XAUTHORITY=$XAUTH -e DISPLAY \
--entrypoint "" hildy:chromium chromium-browser --disable-gpu