You have Vivid installed, and the necessary package with the required version (2:1.02.99) is in Wily. Therefore use the Vivid version of docker. Edit /etc/apt/sources.list.d/docker.list via
sudo nano /etc/apt/sources.list.d/docker.list
and replace the content with
deb https://apt.dockerproject.org/repo ubuntu-vivid main
and update the package database
sudo apt-get update
It's also possible to install the packages in Vivid
cd
wget http://mirrors.kernel.org/ubuntu/pool/main/l/lvm2/dmsetup_1.02.99-1ubuntu1_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/l/lvm2/libdevmapper1.02.1_1.02.99-1ubuntu1_amd64.deb
sudo dpkg -i dmsetup_1.02.99-1ubuntu1_amd64.deb libdevmapper1.02.1_1.02.99-1ubuntu1_amd64.deb
If you have problems with the packages, downgrade via
Docker creates a commit for each line of instruction in Dockerfile. As long as you don’t change the instruction, Docker thinks it doesn’t need to change the image, so use cached image which is used by the next instruction as a parent image. This is the reason why docker build takes long time in the first time, but immediately finishes in the second time.
$ time docker build -t blog .
Uploading context 10.24 kB
Step 1 : FROM ubuntu
---> 8dbd9e392a96
Step 2 : RUN apt-get update
---> Running in 15705b182387
Ign http://archive.ubuntu.com precise InRelease
Hit http://archive.ubuntu.com precise Release.gpg
Hit http://archive.ubuntu.com precise Release
Hit http://archive.ubuntu.com precise/main amd64 Packages
Get:1 http://archive.ubuntu.com precise/main i386 Packages [1641 kB]Get:2 http://archive.ubuntu.com precise/main TranslationIndex [3706 B]Get:3 http://archive.ubuntu.com precise/main Translation-en [893 kB]Fetched 2537 kB in 7s (351 kB/s) ---> a8e9f7328cc4
Successfully built a8e9f7328cc4
real 0m8.589s
user 0m0.008s
sys 0m0.012s
$ time docker build -t blog .
Uploading context 10.24 kB
Step 1 : FROM ubuntu
---> 8dbd9e392a96
Step 2 : RUN apt-get update
---> Using cache
---> a8e9f7328cc4
Successfully built a8e9f7328cc4
real 0m0.067s
user 0m0.012s
sys 0m0.000s
However, when cache is used and what invalids cache are sometimes not very clear. Here is a few cases that I found worth to note.
Cache invalidation at one instruction invalids cache of all subsequent instructions
This is the basic rule of caching. If you cause cache invalidation at one instruction, subsequent instructions doesn’t use cache.
12345678910
# BeforeFrom ubuntu
Run apt-get install ruby
Run echo done!
# AfterFrom ubuntu
Run apt-get update
Run apt-get install ruby
Run echo done!
Since you add Run apt-get update instruction, all instructions after that have to be done from the scratch even if they are not changed. This is inevitable because Dockerfile uses the image built by the previous instruction as a parent image to execute next instruction. So, if you insert an instruction that creates a new parent image, all subsequent instructions cannot use cache because now parent image differs.
Cache is invalid even when adding commands that don’t do anything
This is kind of pitfall of build caching. What I mean by non-idempotent instructions is the execution of commands that may return different result each time. For example, apt-get update is not idempotent because the content of updates changes as time goes by.
12
From ubuntu
Run apt-get update
You made this Dockerfile and create image. 3 months later, Ubuntu made some security updates to their repository, so you rebuild the image by using the same Dockerfile hoping your new image includes the security updates. However, this doesn’t pick up the updates. Since no instructions or files are changed, Docker uses cache and skips doing apt-get update.
If you don’t want to use cache, just pass -no-cache option to build.
1
$ docker build -no-cache .
Instructions after ADD never cached (Only versions prior to 0.7.3)
If you use Docker before v7.3, watch out!
1234
From ubuntu
Add myfile /
Run apt-get update
Run apt-get install openssh-server
If you have Dockerfile like this, Run apt-get update and Run apt-get install openssh-serverwill never be cached.
The behavior is changed from v7.3. It caches even if you have ADD instruction, but invalids cache if file content is changed.
1234567891011
$ echo"Jeff Beck" > rock.you
From ubuntu
Add rock.you /
Run add rock.you
$ echo"Eric Clapton" > rock.you
From ubuntu
Add rock.you /
Run add rock.you
Since you change rock.you file, instructions after Add doesn’t use cache.
Hack to run container in the background
If you want to simplify the way to run containers, you should run your container on background with docker run -d image your-command. Instead of running with docker run -i -t image your-command, using -d is recommended because you can run your container with just one command and you don’t need to detach terminal of container by hitting Ctrl + P + Q.
However, there is a problem with -d option. Your container immediately stops unless the commands are not running on foreground.
Let me explain this by using case where you want to run apache service on a container. The intuitive way of doing this is
1
$ docker run -d apache-server apachectl start
However, the container stops immediately after it is started. This is because apachectlexits once it detaches apache daemon.
Docker doesn’t like this. Docker requires your command to keep running in the foreground. Otherwise, it thinks that your applications stops and shutdown the container.
You can solve this by directly running apache executable with foreground option.
Here we are manually doing what apachectl does for us and run apache executable. With this approach, apache keeps running on foreground.
The problem is that some application does not run in the foreground. Also, we need to do extra works such as exporting environment variables by ourselves. How can we make it easier?
In this situation, you can add tail -f /dev/null to your command. By doing this, even if your main command runs in the background, your container doesn’t stop because tail is keep running in the foreground. We can use this technique in the apache case.
pi@raspberrypi ~ $ uname -a Linux raspberrypi 3.10.24+ #614 PREEMPT Thu Dec 19 20:38:42 GMT 2013 armv6l GNU/Linux pi@raspberrypi ~ $
The important part is 3.10.24+ #614. This is just an example and your version may be different. Select the right driver for the version you have from the list below.
This driver supports wifi modules with the following USB IDs
ID 2001:3310 ID 2001:330F ID 07B8:8179 ID 0BDA:0179 ID 0BDA:8179
and for 3.12.28+ and newer the addition devices:
ID 056E:4008 ID 2001:3311 ID 0DF6:0076
With the wifi dongle connected to your Pi use command lsusb to show a list of USB devices connected to your Pi. You should see your wifi module in the list and the USB ID of the device which you can check is in the list above. If it is read on to find the device driver you need and how to install it.
NOTE: the driver files for 3.18.xx+ and 3.18.xx-v7+ contain two additional files, install.sh and 8188eu.conf. Download the driver file selecting the right driver for your kernel version from the list above then to install the 3.18 drivers first untar the tar.gz driver file and then run the install.sh command.eg.
wget https://dl.dropboxusercontent.com/u/80256631/8188eu-2015yyzz.tar.gz tar xzf 8188eu-2015yyzz.tar.gz ./install.sh
change yyzz in the wget and tar commands to select the right driver file. install.sh will install the driver file and copy the file 8188eu.conf to directory /etc/modprobe.d. The 8188eu.conf file will disable power management for the 8188eu driver and disable the inbuilt driver version r8188eu.
Link to driver files - use date code from list above to download required driver
NOTE: If updating firmware revisions, say from 3.10.23+ to 3.10.24+, and they use the same driver, in this case 8188eu-20131209.tar.gz, you will still need to reinstall the driver on the newer version of Linux, even though the driver has not changed as it will be loaded from a different directory by the new Linux revision and you need to install it in the new directory.
The driver installation instructions expect you to be using Raspbian, either installed from a basic rasbian image or installed using NOOBS. The instructions are based on running from a Command Line Terminal, not a GUI (Graphical User Interface). If you are running using the GUI you will need to open a terminal window and run the commands from the terminal window but I can't guarantee they will work.
If you have a wired internet connection install the driver with the following commands
If you do not have an internet connection the driver file will need to be downloaded on another computer and copied to the SD card. I use a Windows laptop and will use that as an example of how to copy and install the wifi driver.
Open a web browser on your Windows computer and download the driver. Check the name of the driver file before saving it and correct it if necessary. I have sometimes found Windows tries to save the driver file as 8188eu-201xyyzz.tar.tar when it should be 8188eu-201xyyzz.tar.gz. Substitute the correct file name for "xyyzz".
Take the SD card and load it into an SD card reader on your Windows computer. Copy the driver file, 8188eu-201xyyzz.tar.gz, from your Windows computer to the SD card. Safely remove the SD card from the card reader by clicking the safe removal icon in the task bar and install the SD card in your Raspberry Pi and power on and login.
After logging in you will need to copy the driver file to your home directory. How you do this is dependent on whether you installed rasbian using NOOBS or directly from a Rasbian image. If you are running raspbian installed using NOOBS you need to run the following commands to copy the driver file to your home directory
You will need the period, full stop (.), after the filename in the sudo mv command. The mount/umount commands are required as the driver file is in the NOOBS boot directory, not the rasbian boot directory, so the NOOBS boot directory needs mounting and accessing to get to the driver file.
If you installed raspbian directly from a rasbian image use the following command to copy the driver file to your home directory
Once the driver is loaded you will need to configure the network set up so the Pi will connect to your wifi network if it is not already done. There are some basic details on how to do that available here.
To help in installing or updating the driver @LaFambe has produced a very simple script available here which will automatically select and install the correct version of the driver for the version of Raspbian being used. I was quite impressed by it and it really does make life much simpler. You will need an internet connection for the script to work.
Procedure for decoding .apk files, step-by-step method:
Step 1:
Make a new folder and put .apk file in it (which you want to decode). Now rename the extension of this .apk file to .zip (eg.: rename from filename.apk to filename.apk.zip) and save it. Now you get classes.dex files, etc. At this stage you are able to see drawable but not xml and java files, so continue.
Step 2:
Now extract this zip apk file in the same folder (or NEW FOLDER). Now download dex2jar from this linkhttp://code.google.com/p/dex2jar/ and extract it to the same folder (or NEW FOLDER). Now open command prompt and change directory to that folder (or NEW FOLDER). Then write dex2jar classes.dex and press enter. Now you get classes.dex.dex2jar file in the same folder. Then download java decompiler from http://java.decompiler.free.fr/?q=jdgui and now double click on jd-gui and click on open file. Then open classes.dex.dex2jar file from that folder. Now you get class files and save all these class files (click on file then click "save all sources" in jd-gui) by src name. At this stage you get java source but the xml files are still unreadable, so continue.