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
- 一個dockerfile例子(參考著寫dockerfile)Docker
- Dockerfile入門(使用Dockerfile生成jdk1.8映象)DockerJDK
- X11Window X11 ErrorError
- 編寫DockerFileDocker
- Dockerfile筆記Docker筆記
- Dockerfile編寫Docker
- dockerfile 語法Docker
- Dockerfile學習Docker
- Dockerfile入門Docker
- Dockerfile詳解Docker
- Dockerfile常用指令Docker
- dotnet X11 呼叫 XRootWindow 是否耗時
- Dockerfile 命令詳解Docker
- Docker的Dockerfile指令Docker
- Dockerfile定製映象Docker
- Dockerfile:ADD VS COPYDocker
- Docker_07 DockerfileDocker
- Docker 入門:DockerfileDocker
- Docker學習—DockerFileDocker
- dockerfile測試例子Docker
- Dockerfile指令詳解Docker
- Dockerfile中相似命令Docker
- 如何編寫DockerfileDocker
- 倉庫管理、dockerfileDocker
- DockerFile構建映象Docker
- [Dockerfile構建映象]Docker
- Dockerfile檔案詳解Docker
- DockerFile基礎知識Docker
- 學習編寫DockerfileDocker
- Docker筆記之DockerfileDocker筆記
- Docker--DockerFile與映象Docker
- Dockerfile中指令詳解Docker
- 使用 Dockerfile 定製映象Docker
- go專案dockerfile示例GoDocker