Dockerfile and X11 XQuartz 2.7.8 on Mac
- Use XQuartz version: XQuartz 2.7.8, else it may have libGL error!
- set XQuartz preferences --> Security --> Tick all connections
- in
/etc/ssh/sshd_config
setx11forwarding
to yes (there are two x11forwarding, all set from no to yes)
The bash scripts used to run docker (after install the docker image)—>
#!/bin/bash
IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
/usr/X11/bin/xhost + $IP &
docker run -e DISPLAY=$IP:0 -v /tmp/.X11-unix:/tmp/.X11-unix -p 7000-7010:7000-7010 -v ~/.cache/Xauthority -v /Users/jerry/Documents/diamond:/opt/lpzrobots -it lpzrobots /bin/bash
#docker run --rm -e DISPLAY=$DISPLAY --net=host -v ~/.cache/Xauthority -v /home/simon/Documents/artificial/projects/diamond/lpzrobots:/opt/lpzrobots -it --name lpzrobots lpzrobots_image /bin/bash
#docker run --rm -e DISPLAY=$DISPLAY --net=host -v ~/.cache/Xauthority -it --name lpzrobots lpzrobots_image /bin/bash
The dockerfile:
# Last time I build it ubuntu:latest was 18.04.1. File might fail in the future
# if so, update next line to that version
FROM ubuntu:18.04
RUN apt-get -y update && apt-get install -y \
g++ make automake libtool xutils-dev m4 libreadline-dev libgsl0-dev \
libglu-dev libgl1-mesa-dev freeglut3-dev libopenscenegraph-dev \
libqt4-dev libqt4-opengl libqt4-opengl-dev qt4-qmake libqt4-qt3support gnuplot gnuplot-x11 \
libncurses5-dev git firefox
RUN apt-get update
RUN apt-get install -qqy x11-apps
RUN cd /opt; git clone https://github.com/artificialsimon/diamond.git #redo
RUN echo ''\
'# configuration file for lpzrobots (automatically generated!)\n'\
'# # Where to install the simulator and utils\n'\
'PREFIX=/usr/local\n'\
'#\n'\
'# # user or developement installation\n'\
'# # Options:\n'\
'# # DEVEL: only install the utility functions,\n'\
'# # which is useful for development on the simulator\n'\
'# # USER: install also the ode_robots and selforg libaries and include files\n'\
'# # this is recommended for users\n'\
'TYPE=USER\n'\
>>/opt/diamond/Makefile.conf
RUN cd /opt/diamond; make all
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/issue && cat /etc/motd' \
>> /etc/bash.bashrc \
; echo ""\
"##################################################\n"\
"# lpzrobots install directory: #\n"\
"# /opt/diamond #\n"\
"# #\n"\
"# More information can be found under: #\n"\
"# https://github.com/georgmartius/lpzrobots #\n"\
"##################################################\n"\
>>/etc/motd
RUN echo '\n\
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH'\
>> /root/.bashrc
相關文章
- XQuartz 使用方法quartz
- 2.7.8 匯出伺服器引數檔案(SPFILE)伺服器
- DockerfileDocker
- Dockerfile技巧Docker
- Docker DockerfileDocker
- 一個dockerfile例子(參考著寫dockerfile)Docker
- Dockerfile入門(使用Dockerfile生成jdk1.8映象)DockerJDK
- dockerfile 語法Docker
- Dockerfile編寫Docker
- Dockerfile常用指令Docker
- 編寫DockerFileDocker
- Dockerfile入門Docker
- Dockerfile詳解Docker
- Dockerfile建立映象Docker
- CentOS kafka dockerfileCentOSKafkaDocker
- CentOS zookeeper dockerfileCentOSDocker
- Dockerfile筆記Docker筆記
- Dockerfile學習Docker
- X11Window X11 ErrorError
- Docker 入門:DockerfileDocker
- Docker_07 DockerfileDocker
- [Dockerfile構建映象]Docker
- DockerFile構建映象Docker
- Dockerfile 命令詳解Docker
- Docker的Dockerfile指令Docker
- Docker學習—DockerFileDocker
- 倉庫管理、dockerfileDocker
- Dockerfile定製映象Docker
- Docker 基礎 : DockerfileDocker
- Dockerfile構建MySQLDockerMySql
- Dockerfile指令詳解Docker
- 如何編寫DockerfileDocker
- Dockerfile中相似命令Docker
- dockerfile測試例子Docker
- Chrome OS 用 Freon 替換 X11Chrome
- Linux/X11 Foobillard 檯球(轉)Linux
- dotnet X11 呼叫 XRootWindow 是否耗時
- Dockerfile你值得擁有Docker