Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Switch to thewtex/centos-build:v1.0.0 base for Slicer compatibility #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 51 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
FROM dockcross/base:latest
MAINTAINER Matt McCormick <matt.mccormick@kitware.com>
FROM thewtex/centos-build:v1.0.0
MAINTAINER Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

ENV DEFAULT_DOCKCROSS_IMAGE thewtex/opengl

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
libgl1-mesa-dri \
menu \
RUN yum update -y && \
yum install -y \
mesa-libGL \
net-tools \
openbox \
python-pip \
sudo \
supervisor \
tint2 \
x11-xserver-utils \
x11vnc \
xinit \
xserver-xorg-video-dummy \
xserver-xorg-input-void \
websockify && \
rm -f /usr/share/applications/x11vnc.desktop && \
pip install supervisor-stdout && \
apt-get -y clean
xorg-x11-server-utils \
xorg-x11-server-Xvnc-source \
xorg-x11-xinit \
xorg-x11-drv-dummy \
xorg-x11-drv-void

RUN wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py && \
python get-pip.py

RUN rm -f /usr/share/applications/x11vnc.desktop && \
pip install websockify supervisor supervisor-stdout && \
mkdir /var/log/supervisor/

# Following package are required for building x11vnc
RUN yum install -y \
libjpeg-devel \
libXcursor-devel \
libXinerama-devel \
libXrandr-devel \
libXt-devel \
libXtst-devel

RUN wget "http://downloads.sourceforge.net/project/libvncserver/x11vnc/0.9.13/x11vnc-0.9.13.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Flibvncserver%2Ffiles%2Fx11vnc%2F0.9.13%2F&ts=1475558391&use_mirror=heanet" && \
tar -xzvf x11vnc-0.9.13.tar.gz && \
cd x11vnc-0.9.13 && \
./configure && \
make -j8 && \
make install

COPY etc/skel/.xinitrc /etc/skel/.xinitrc

Expand All @@ -30,14 +42,28 @@ USER user

RUN cp /etc/skel/.xinitrc /home/user/
USER root
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/user

RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers

RUN git clone https://github.com/kanaka/noVNC.git /opt/noVNC && \
cd /opt/noVNC && \
git checkout 6a90803feb124791960e3962e328aa3cfb729aeb && \
ln -s vnc_auto.html index.html

# Install OpenBox
RUN wget ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/x86_64/RPMS/openbox-libs-3.4.7.2-5.el5.kb.x86_64.rpm && \
wget ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/x86_64/RPMS/openbox-3.4.7.2-5.el5.kb.x86_64.rpm && \
yum install --nogpgcheck -y openbox*.rpm

# Following package are required for building x11vnc
RUN yum install -y \
mesa-libGLU

RUN cd x11vnc-0.9.13 && \
./x11vnc/misc/Xdummy && \
./x11vnc/misc/Xdummy -install && \
cp ./x11vnc/misc/Xdummy /usr/local/bin/ && \
cp ./x11vnc/misc/Xdummy.so /usr/local/bin/

# noVNC (http server) is on 6080, and the VNC server is on 5900
EXPOSE 6080 5900

Expand All @@ -47,4 +73,5 @@ COPY usr /usr
ENV DISPLAY :0

WORKDIR /root
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]

CMD ["/usr/local/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

script_dir="`cd $(dirname $0); pwd`"

docker build -t thewtex/opengl $script_dir
docker build -t slicer/opengl $script_dir
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please retain the current default. Also, please rebase this branch on master, which has parameterized Makefile build support.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thewtex If we retain the current default thewtex/opengl there will be 2 same name for 2 different docker image.. I suggest to rename it into thewtex/centos-opengl or centos/opengl

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using different tag. E.g thewtex/opengl:jessie-1.0.0, thewtex/opengl:centos-1.0.0, ...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

2 changes: 1 addition & 1 deletion etc/skel/.xinitrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

xsetroot -solid "#333333"
(sleep 2s && tint2 -c /etc/xdg/tint2/tint2rc) &
#(sleep 2s && tint2 -c /etc/xdg/tint2/tint2rc) &
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a change made by @jcfr to be able to use X11 on centos.
I think I did some bad manipulation with the commit because the commit he made doesn't appear.. I'm going to fix everything.

openbox
2 changes: 1 addition & 1 deletion etc/supervisor/conf.d/xdummy.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[program:xdummy]
command=bash -l -c "xinit -- :0 -nolisten tcp vt$XDG_VTNR -noreset +extension GLX +extension RANDR +extension RENDER +extension XFIXES"
command=bash -l -c "Xdummy :0 -nolisten tcp vt$XDG_VTNR -noreset +extension GLX +extension RANDR +extension RENDER +extension XFIXES"
user=user
environment=HOME=/home/user,USER=user,QT_X11_NO_MITSHM=1
directory=/home/user
Expand Down
6 changes: 3 additions & 3 deletions example/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM thewtex/opengl:latest
FROM slicer/opengl:latest
MAINTAINER Matt McCormick <matt.mccormick@kitware.com>

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
mesa-utils
RUN yum update -y && \
yum install -y glx-utils

ENV APP "glxgears"
2 changes: 1 addition & 1 deletion example/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

script_dir="`cd $(dirname $0); pwd`"

docker build -t thewtex/opengl-example $script_dir
docker build -t slicer/opengl-example $script_dir
2 changes: 1 addition & 1 deletion example/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

script_dir="`cd $(dirname $0); pwd`"

$script_dir/../run.sh -c opengl-example -i thewtex/opengl-example -p 6081 "$@"
$script_dir/../run.sh -c opengl-example -i slicer/opengl-example -p 6081 "$@"
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

container=opengl
image=thewtex/opengl
image=slicer/opengl
port=6080
extra_run_args=""
quiet=""
Expand Down