Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
blog:first_entry [2014/10/07 03:15]
imcsk8 [RPM]
blog:first_entry [2014/10/07 06:14] (current)
imcsk8
Line 1: Line 1:
 ====== Docker on ARM ====== ====== Docker on ARM ======
  
-I created ​patch and a RPM for docker on arm +For project i'm working on i needed to run docker on a cubietruck, 
 +this boards use a dual core cortex A7 so i needed it to run on ARM 
 +architectures. In the docker web page there'​s a mention that i works 
 +on ARM and other architectures.\\
  
 ==== Compilation ==== ==== Compilation ====
 +
 +Befora i tried to create a package or install it system wide i tried
 +to compile it on the cubietruck, it was pleasant to see that i compiled
 +without any problems:
 +
 <​code>​ <​code>​
 git clone <docker sources> git clone <docker sources>
Line 10: Line 17:
 hack/​make.sh dynbinary hack/​make.sh dynbinary
 </​code>​ </​code>​
 +\\
 +Once it compiled i tried to run it, this time i got dissapointed
 +
 +<​code>​
 +$ docker -D -d -H unix:///​var/​run/​docker.sock
 +The Docker runtime currently only supports amd64 (not arm). This will change in the future. Aborting.
 +</​code>​
 +\\
 +Apparently the upstream guys don't think it is a good idea to run it on 
 +ARM architectures. Since i know that LXC is working with no problem in the 
 +the latest Linux kernels i put myself to the task of making it work.\\
 +A little grepping showed that there'​s just one if that aborts the execution
 +on non x86_64 architectures (for some reason the go language identifies it as
 +amd64) so i created a little patch [[#​arm-patch|[1]]] to make it work.
 +
 +<​code>​
 + func checkKernelAndArch() error {
 +  // Check for unsupported architectures
 +- if runtime.GOARCH != "​amd64"​ {
 +- return fmt.Errorf("​The Docker runtime currently only supports amd64 (not %s). This will change in the futu
 +re. Aborting.",​ runtime.GOARCH)
 ++    if (runtime.GOARCH != "​amd64"​) && (runtime.GOARCH != "​arm"​) {
 ++ return fmt.Errorf("​The Docker runtime currently only supports amd64 or arm (not %s). This will change in t
 +he future. Aborting.",​ runtime.GOARCH)
 +  }
 +  // Check for unsupported kernel versions
 +  // FIXME: it would be cleaner to not test for specific versions, but rather
 +</​code>​
 +\\
 +Compiled it again and this time docker run without problems! :)
 +\\
 +==== Packaging ====
 +
 +Since i've been spending a lot of time building RPM packages i cloned the
 +package from the fedora git repos and added the patch to it.
 +\\
 +
  
-==== RPM ==== 
 change ExclusiveArch to {%go_arches} change ExclusiveArch to {%go_arches}