Skip to main content

docker on 32bit system (windows 7 on core2duo)

Docker is very usefull tool for fast shipping application with its dependicies. It's totally different from Vagrant which I used before . Using them both may be very powerfull tool. So I started to play with docker but I had problem - my everyday environment is Debian but at my work I got 32bit core 2 duo workstation with windows7 installed (and no possibility to work on my laptop - security). Fortunatelly this processor has VT-x support so I could run 64bits virtual machines. I wanted to install boot to docker but unfortunatelly installation and boot2docker.exe are for 64 bits only so I just used their iso image because it was very lightweigh. First of all I had to convert this "live cd" image to vmdk I used this one

http://static.dockerfiles.io/boot2docker-v1.2.0-virtualbox-guest-additions-v4.3.14.iso qemu-img convert -f raw -O vmdk Nowyfolder/boot2docker.iso boot2docker-disk.vmdk

Now we have ready boot2docker disk out of live image. Start virtualbox, create new virtualmachine, select linux 64bits, and when there will be step with disk choose Existing disk option and select newly created boot2docker-disk.vmdk

after all I could start to create new virtualbox machine and select vmdk disk to existing one boot2docker-disk.vmdk we have ready and working virtual boot2docker machine .

docker

First download download pre build image :

sudo docker pull ubuntu

run pseudo tty:

sudo docker run -t -i ubuntu /bin/bash

get image of running docker:

sudo docker ps

output: ➜ ~ sudo docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES c4fbc80d8926 ubuntu:14.04 /bin/bash 3 minutes ago Up 3 minutes berserk_nobel ➜ ~ save container as your image: ============================= sudo docker commit c4fbc80d8926 myimage_name

Running our image:

sudo docker run -t -i myimage_name /bin/bash

Deploying your app and dependicies:

watch out to save container before you quit bash inside docker instance find container id and save

Diff image container:

sudo docker diff

Start docker container with name:

sudo docker run -i -t --name="IWAPPS2" iwapps /bin/bash

Commit with name :

sudo docker commit IWAPPS2 local -a "greg" -m "First image commit"

Actually, images are stored within /var/lib/docker/aufs/diff

OUP sudo docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 95585eb7ea3c cc68531a3552 /bin/bash About a minute ago Up About a minute mad_ptolemy ➜ OUP sudo docker commit 95585eb7ea3c iwps2 -a "greg" -m "First image commit" c86eeb858bedf779105f759ca62d10ea59e01884e985e447d9ddf7f65ee32e3c ➜ OUP sudo docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE iwps2 latest c86eeb858bed 5 seconds ago 617.5 MB local latest 539a99ee88ee 22 minutes ago 348.5 MB <none> <none> d8f374aecae4 2 hours ago 348.1 MB iwapps latest 85e0ae955062 4 hours ago 348.1 MB ubuntu utopic b8d67033ed07 23 hours ago 286.6 MB ubuntu 14.10 b8d67033ed07 23 hours ago 286.6 MB ubuntu trusty 1357f421be38 23 hours ago 192.7 MB ubuntu latest 1357f421be38 23 hours ago 192.7 MB ubuntu 14.04 1357f421be38 23 hours ago 192.7 MB ubuntu 14.04.1 1357f421be38 23 hours ago 192.7 MB ubuntu 12.04 2bed76595591 23 hours ago 120.2 MB ubuntu 12.04.5 2bed76595591 23 hours ago 120.2 MB ubuntu precise 2bed76595591 23 hours ago 120.2 MB <none> <none> 96864a7d2df3 3 weeks ago 205.1 MB ubuntu 12.10 c5881f11ded9 3 months ago 172.2 MB ubuntu quantal c5881f11ded9 3 months ago 172.2 MB ubuntu raring 463ff6be4238 3 months ago 169.4 MB ubuntu 13.04 463ff6be4238 3 months ago 169.4 MB ubuntu saucy 195eb90b5349 3 months ago 184.7 MB ubuntu 13.10 195eb90b5349 3 months ago 184.7 MB ubun

pt The images are stored in /var/lib/docker/graph/<id>/layer.

Note that images are just diffs from the parent image. The parent ID is stored with the image's metadata /var/lib/docker/graph/<id>/json.

When you docker run an image. AUFS will 'merge' all layers into one usable file system.

docker inspect docker images --no-trunc=true

Running an interactive shell sudo docker run -i -t ubuntu /bin/bash

sudo baobab /var/lib/docker

docker pull ubuntu docker run -i -t ubuntu:14.04 /bin/bash sudo docker info sudo docker version sudo docker search ubuntu sudo docker pull ubuntu sudo docker images

create blog with nikola

Sometimes blogs are not so bad to write your thoughts. This is good place to come back for solution we've found previously spending hours searching for it .

If we want to have more options to edit blog style or anything or host it on our server or github there are a lot of blog generators . One of them is Nikola .. link:http://getnikola.com/

First of all just install nikola with pip on your system (best way is to use python virtualenv for python applications)

pip install nikola

then start new blog

nikola init my_blog

You can choose between themes http://themes.getnikola.com/ to list available themes

nikola install_theme -l

there is also possibility to use bootswatch theme http://bootswatch.com/ remember not all themes works with bootswatch

nikola install_theme bootstrap3-jinja
nikola bootswatch_theme -n custom_theme -s amelia -p bootstrap3-jinja

Linux list openports with processes names

netstat -putln

-p the PID and name of the program to which each socket belongs.

-u udp

-t tcp

-l only listening sockets. (These are omitted by default.)

-n numeric port number

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
 Active Internet connections (only servers)
 Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
 tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
 tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -
 tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      -
 tcp        0      0 127.0.0.1:5433          0.0.0.0:*               LISTEN      -
 tcp        0      0 0.0.0.0:902             0.0.0.0:*               LISTEN      -
 tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -
 tcp        0      0 0.0.0.0:9418            0.0.0.0:*               LISTEN      -
 tcp        0      0 127.0.0.1:2222          0.0.0.0:*               LISTEN      -
 tcp        0      0 0.0.0.0:9614            0.0.0.0:*               LISTEN      -
 tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      -
 tcp        0      0 127.0.0.1:5939          0.0.0.0:*               LISTEN      -
 tcp6       0      0 :::22                   :::*                    LISTEN      -
 tcp6       0      0 ::1:631                 :::*                    LISTEN      -
 tcp6       0      0 :::25                   :::*                    LISTEN      -
 tcp6       0      0 :::9418                 :::*                    LISTEN      -
 udp     5376      0 0.0.0.0:5353            0.0.0.0:*                           2934/libpepflashpla
 udp        0      0 0.0.0.0:5353            0.0.0.0:*                           -
 udp        0      0 0.0.0.0:46482           0.0.0.0:*                           -
 udp        0      0 0.0.0.0:631             0.0.0.0:*                           -
 udp6       0      0 :::5353                 :::*                                -
 udp6       0      0 :::57898

ssh reverse tunneling

When you want someone to connect to your NAT-ed or Firewalled server and

you run out of ideas ond options or you even dont have

you dont have access to Firewall or VPN server to configure

anything - you can always try to use reverse ssh tunnel.

The only one condition is that you must be able to ssh from your server to public host( the one other guy wants to connect)

This is how it works:

[Server] <----> [ FIREWALL/NAT SERVER ] <----> [ BOB HOST with public ip 80.80.80.80]