Docker-desktop and ubuntu 12.04

(Update 26/11/13) Docker 0.6.5 has a breaking change with ports and exposed.  It does not provide a port number when you run sudo docker port $CONTAINER_ID 22 anymore. You can assign the port you expose when you do the docker run command as shown below.

To get ubuntu 12.04 to connect to the xpra on the docker-desktop you need to do a few things to get a newer version of Xpra to install.

Ubuntu 12.04 has 0.0.7.36 which is a few years old now.

Ubuntu does not give you an updated version on its packages it knows about so you have to include a new apt-get repo to find it.

Explanation

Docker-desktop uses ubuntu 12.10 which has xpra version 0.3.11.  This is acting as the server.

On your ubuntu 12.04(client) has xpra version 0.0.7.36 will never connect properly to xpra(sever) 0.3.11 it will seem to connect but never log any information about what is going wrong and what is not working.

The 12.04(client) needs to update to xpra to version 0.9.8-1.  I have not gotten versions above 0.9.8-1 to work with xpra 0.3.11(server), tt has problems with rendering the screen.

Get version 0.9.8-1 of xpra installed on ubuntu 12.04

# do the following as root as the adding pgp does not work via sudo
sudo su –

# add the pgp key for the source repo
curl http://winswitch.org/gpg.asc | apt-key add –

#add the source to
echo “deb http://winswitch.org/ precise main” > /etc/apt/sources.list.d/winswitch.list

#remove any old version of xpra with vengeance
apt-get purge xpra; apt-get autoremove; apt-get -f install;

#get the latest apt package list
apt-get update

#install a version of xpra 0.9.8-1 that will be able to see the xpra from the docker-desktop install.
apt-get install xpra=0.9.8-1

# Hold onto the version of 0.9.8-1 on the client until you upgrade the server.
apt-mark hold xpra

#Exit as root
exit

Original docker-desktop instructions

# Install, you will see another warning that the package cannot be authenticated. Confirm install.  Do not forget your git and docker on the Ubuntu vagrant node.
sudo apt-get install git lxc-docker

#on vagrant node on mac
docker build -t vagrant/docker-desktop git://github.com/rogaha/docker-desktop.git

#attach to container
#new to 0.6.5 is the assigning a port to the exposed port in the docker file

CONTAINER_ID=$(sudo docker run -p 44:22 -d vagrant/docker-desktop)

#get password for container.  I like to stick it in a file as I end up forgetting it too frequently.
echo $(sudo docker logs $CONTAINER_ID | sed -n 1p)

#get ipaddress for box It will be similar to 172.17.0.2
ifconfig | grep “inet addr:”

# start up the docker-desktop with a slightly larger screen so Xpra on the mac does attach.
ssh docker@172.17.0.2 ./docker-desktop -s 1000×800 -d 10

Setup the docker-desktop instance to display firefox

#From the mac command line SSH onto the box and set the display to be firefox
ssh docker@172.17.0.2

# setup display to show firefox
DISPLAY=:10 firefox &
exit

Attach to the docker-desktop from terminal.

# port is now 44 as we assigned it in the run command for the docker container.
xpra –ssh=”ssh -p 44″ attach ssh:docker@172.17.42.1:10

Thanks again to Roberto G. Hashioka for creating this.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s