Skip to content
This repository has been archived by the owner on Dec 12, 2019. It is now read-only.

tips_x11_docker

Grimmer edited this page May 10, 2017 · 5 revisions

You can try Ubuntu or CentOS

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

Docker run parameters

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
  1. -rm: docker container will be closed when the terminal is closed.
  2. -u 1000: use non-root.
  3. -p 8080:8080: listen port mapping of CARTA server.
  4. -ti: terminal input/output.
  5. -e DISPLAY=$DISPLAYARG: setup the x11 server of x11 window as the host machine's ip.
  6. -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.

You can install xxlock and execute xclock to test if your x11 window works or not

yum install xclock

Install needed x11 libraries on CentOS

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/

  1. yum -y install bus
  2. dbus-uuidgen > /var/lib/dbus/machine-id

Some extra tips on CentOS

yum install sudo less which

Install needed x11 libraries on Ubuntu

apt-get update
apt-get install -y x11-apps ## includes xclock
apt-get libx11-xcb-dev libdbus-1-3 ## needed by launching qt creator

Some extra tips on Ubuntu

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