-
Notifications
You must be signed in to change notification settings - Fork 0
tips_x11_docker
Examples:
docker pull ubuntu:16.04 (tried and OK)
docker pull ubuntu:14.04
docker pull centos:7.3.1611 (tried and OK)
docker pull centos:6.8
Here is a part of the content, dockerrun.sh
docker run --rm -u 1000 -p 8080:8080 -p 9999:9999 -ti --name carta \
-w="/home/developer" -e DISPLAY=$DISPLAYARG \
-e SHELL="/bin/bash" \
-v /tmp/.X11-unix:/tmp/.X11-unix -v $DIR/../../:/home/developer/src/CARTAvis \
carta/cartabuild:base_20170105 /bin/bash
-
-rm
: docker container will be closed when the terminal is closed. -
-u 1000
: use non-root. -
-p 8080:8080
: listen port mapping of CARTA server. -
-ti
: terminal input/output. -
-e DISPLAY=$DISPLAYARG
: setup the x11 server of x11 window as the host machine's ip. -
-v /tmp/.X11-unix:/tmp/.X11-unix
: about x11 setting, using mount volume of Docker.
no.5 and no.6 are needed for running CARTA desktop in Docker way. And the effect of no.5 (just x11 environment variable) can be setup in Docker container if you forget, but no.6 can not be setup once you launch this Docker container.
yum install xclock
yum -y install fontconfig fontpackages-filesystem libXfont libfontenc xorg-x11-font-utils xorg-x11-fonts-Type1
Extra setup on CentOS 6 to solve the errors of x11:
D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open “/var/lib/dbus/machine-id”
Follow this guide and setup http://www.torkwrench.com/2011/12/16/d-bus-library-appears-to-be-incorrectly-set-up-failed-to-read-machine-uuid-failed-to-open-varlibdbusmachine-id/
- yum -y install bus
dbus-uuidgen > /var/lib/dbus/machine-id
yum install sudo less which
apt-get update
apt-get install -y x11-apps ## includes xclock
apt-get libx11-xcb-dev libdbus-1-3 ## needed by launching qt creator
apt-get install -y sudo
sudo apt-get install aptitude (then you can type `sudo aptitude search flex` to search)
sudo apt-get install vim
sudo apt-get install -y less