文档章节

96Boards(410C)中的Docker使用方法

openthings
 openthings
发布于 2016/12/09 08:13
字数 1181
阅读 155
收藏 1
点赞 0
评论 0

ARM64已经成为手机上的主流,而且开始进入服务器领域(中国的全志、辉腾等芯片也都是ARM架构),很多开发板也相继推出。为了充分发挥其能力,我希望能在上面运行Docker。但是,目前虽然ARM32上面已经有多个Docker移植版本,但是ARM64上很多不可用。下面是96Boards(410C)的系统中Docker使用方法,目前只有1.9.1版本,更新版本需要自己安装源码编译(参考:https://my.oschina.net/u/2306127/blog/801867)。

注意:

以下内容来自于:https://github.com/96boards/documentation/blob/master/ConsumerEdition/CE-Extras/DockerCE.md,查看最新版本信息,请看原文。

Instructions for Installing Docker on a Consumer Edition 96Boards

This document will show you how to install and test the Debian Docker apt package on the 96Boards with 1GB RAM using the Reference Platform Build 16.03 which is available here. This document was created for Docker v1.9.1.

This material was covered in our 6th OpenHours session and can be paired with this blog.

First of all you need a kernel on your 96Boards which meets the Docker requirements. To check the kernel support for Docker, you can run the following script

$ sudo ./check-config.sh .

This script can be found in /usr/share/docker/ or /usr/share/docker.io/contrib, or on github at https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh

The output of the script is a Docker critique of your kernel config. For the 16.03 Reference Platform Build kernel, the results should look like this:

Image1

This was the standard 96Boards kernel from the 16.03 Reference Platform Build, it meets all the mandatory requirements.

With the overlays for the Reference Platform Build, you can run Docker on Debian Jessie, this is the distro version supported by the Reference Platform Build. You are now ready to install Docker. The instructions on docker.com point you to adding x86-based package repos to sources.list.d, which is problematic for obvious reasons. Please skip those and use the standard Debian repositories with:

$ sudo apt-get install docker-engine

This will install Docker version 1.9.1.

Running Docker

Docker installs a daemon and a client. To start with daemon enter the following:

$ sudo service docker start

Docker is not very architecture aware, yet. In fact, running the following command on an ARM-based system will give you a FATAL “Cannot start container” error:

$ docker run -ti ubuntu /bin/bash

This is because Docker tried to run an x86 container image from hub.docker.com on your ARM hardware. You need to explicitly reference Docker images for the aarch64 architecture, or roll your own. The Docker Hub repository has some ‘experimental’ images for aarch64 which worked fine for me.

Running a first container is a case of:

$ sudo docker run -it aarch64/ubuntu /bin/bash

Image2

This will fetch an image for Ubuntu Xenial from the aarch64 directory at hub.docker.com, and launch it with a shell interactively. Once the image is launched it is called a container and has a container ID. From the container command line prompt, if you type e.g.

$ cat /etc/apt/sources.list

You should see that you’re in an Ubuntu image rather than the Debian Stretch host. Exiting the shell kills and removes the container. You can launch the same image several times with docker run to have several independent containers.

Here are two Ubuntu docker containers running on this 96Boards example. The following command will list all running containers and their status:

$ sudo docker ps

Although this document shows the same image for both, they are separate running instances and have different container IDs

Image2

(Note: you can create a docker group to avoid having to sudo everything)

Building a Docker Base Image

You can create a new Docker base image (an image which does not depend on another Docker image) for a Debian-based distro using debootstrap.

Here you will see how to do it with a base Stretch aarch64 Docker image.

This example uses a USB thumb drive (at /dev/sda1) on a 96Boards to avoid running out of storage space. The USB drive needs to be mounted with -o exec.

$ sudo apt-get install debootstrap
$ sudo umount /dev/sda1
$ sudo mount -o exec /dev/sda1 /media/linaro/thumb
$ sudo debootstrap --arch arm64 stretch /media/linaro/thumb/stretch

Debootstrap needs to be told to create an arm64 (aarch64) rootfs.

Then create a tarfile from the rootfs and pipe it into docker import.

$ sudo tar -C /media/linaro/thumb/stretch/ -cf ~/stretch.tar .
$ cat stretch.tar | sudo docker import - mystretchbase

Our Stretch Docker base image is called mystretchbase. It exists on our local machine along with the cached copy of the ubuntu image we loaded earlier from hub.docker.com:

$ sudo docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
mystretchbase     latest              2ce74caa6a46        17 hours ago        277.1 MB
aarch64/ubuntu      latest              08b9525bda5d        6 days ago          114.1 MB

We can launch it with the following command:

$ sudo docker run -it mystretchbase /bin/bash

Wrap Up

We installed the Docker package for Debian Jessie giving Docker functionality on an aarch64 board with only 1GB of RAM. If you have an Enterprise-class board with a decent amount of RAM there is a guide to compiling Docker from source found here

To try out your running container, why not install an Apache web server in it? By default, containers have an IP address and network access via a Docker networking bridge. Although containers are automatically assigned an IP address, inherent DNS for containers is not supported on Docker 1.9.1 - installed in this post - but will be available in 1.10. If you want DNS then you will have to add it either to your host - or of course it could be as another flavour of container - providing a DNS server. Once you’ve built any container you’re happy with, you can save the image for later use. You can also automate re-creating the image by recording the steps in a Dockerfile and using docker build.

© 著作权归作者所有

共有 人打赏支持
openthings
粉丝 249
博文 902
码字总数 469377
作品 1
东城
架构师
ARM64上的Docker编译与安装

ARM64已经成为手机上的主流,而且开始进入服务器领域(中国的全志、辉腾等芯片也都是ARM架构),很多开发板也相继推出。为了充分发挥其能力,我希望能在上面运行Docker。但是,目前虽然ARM32...

openthings
2016/12/08
140
0
华为最新开源开发板 HiKey960 发布 配置强悍

3月6日-10日,Linaro Connect BUD17大会火热进行中。本次大会上,华为携手合作伙伴诚迈科技即将推出的96Boards家族新成员HiKey960抢先亮相。 据了解,Hikey960是基于Kirin960 SoC的96Boards,...

局长
2017/03/09
3.7K
18
ARM64上Docker编译问题与解决

编译过程 在96Boards 的410C上编译Docker(这里使用Dokcer 1.14 Master版本,方法参考),遇到些问题,解决方法如下: 修改Docker源码目录下的Dockerfile.aarch64文件 修改 FROM aarch64/ubu...

openthings
2016/12/10
44
0
ARM 开放平台规范--96Boards

96Boards 是 ARM 开放平台规范,是第一个定义 Cortex-A 开发板的开放规范,Cortex-A 是 ARM SoC 供应商提供的低耗能,小脚本 32 位和 64 位开发板。标准化扩展 Peripheral I/O 总线,显示和相...

叶秀兰
2015/03/03
3.7K
1
DragonBoard 高通推出 IoT板 hitting raspberry pi

https://developer.qualcomm.com/hardware/dragonboard-410c

Jr小王子
2016/12/13
9
0
Snappy Ubuntu Core 登陆 Bubblegum-96 单板机

Canonical的April Wang今天非常荣幸的宣布面向嵌入式和物联网设备的Snappy Ubuntu Core操作系统正式登陆Bubblegum-96单板计算机(SBC)。Bubblegum-96单板机由uCRobotics设计,装备了时钟频率...

oschina
2016/08/05
1K
3
在高通410c开发板使用PyQt开发电动窗帘Demo(四)

本文继续介绍在高通410c开发板上开发电动窗帘Demo的开发步骤 使用QtDesigner开发UI 7. 任务列表操作 创建Push Button控件到主窗体中,作为添加任务列表按钮,设置如下: 创建Push Button控件...

conglf
05/11
0
0
DockerFly v20170508 发布,功能好用易上手

Dockerfly是基于 Docker1.12+ (Docker API 1.24+) 开发出Docker 管理工具,提供里最基本的基于 Docker 的管理功能,目的是能够方便广大Docker初学者以及 Docker 管理员能够快速的进行Docker 容...

愚民日记
2017/05/10
1K
2
Docker 从入门到放弃(二)容器使用

Docker 容器使用 一、Docker 客户端 docker 客户端非常简单 ,我们可以直接输入 docker 命令来查看到 Docker 客户端的所有命令选项。 root@iZ235mi4a64Z:~# docker Usage: docker COMMAND A ...

tinywan1227
2017/12/05
0
0
Dockerfly V20170227 发布,docker 的 web 管理工具

Dockerfly是基于 Docker1.12+ (Docker API 1.24+) 开发出Docker 管理工具,提供里最基本的基于 Docker 的管理功能,目的是能够方便广大Docker初学者以及 Docker 管理员能够快速的进行Docker 容...

愚民日记
2017/02/27
2.1K
13

没有更多内容

加载失败,请刷新页面

加载更多

下一页

全新内存布局Android5 for one x

众所周知Android5.0默认ART模式,运行速度加倍,软件占用内存也加倍,我们one x这种元老机采用旧的内存布局,data空间2g ART模式下安装几个软件也就不够用了。最近逛国外的xda论坛,发现有大...

CrazyManDF
9分钟前
0
0
web3j转账

 web3 转账功能   为了完成以太坊交易,必须有几个先决条件   1、对方的以太坊地址   2、确定要转账的金额   3、自己地址的转账权限   4、大于转账金额的以太币,以太币转账其实就...

智能合约
9分钟前
0
0
10.28 rsync工具介绍 , rsync常用选项, rsync通过ssh同步

rsync远程同步 重点!重点!!重点!!! 例子 • rsync -av /etc/passwd /tmp/1.txt • rsync -av /tmp/1.txt 192.168.188.128:/tmp/2.txt rsync格式 • rsync [OPTION] … SRC DEST • rs......

Linux_老吴
23分钟前
0
0
iis php 环境搭建,非常详细的教程

准备篇 一、环境说明: 操作系统:Windows Server 2016 PHP版本:php 7.1.0 MySQL版本:MySQL 5.7.17.0 二、相关软件下载: 1、PHP下载地址: http://windows.php.net/downloads/releases/ph...

T_star
25分钟前
0
0
Day35 rsync通过服务同步

rsync通过服务同步 rsyncd.conf配置文件详解 port:指定在哪个端口启动rsyncd服务,默认是873端口。 log file:指定日志文件。 pid file:指定pid文件,这个文件的作用涉及服务的启动、停止等...

杉下
31分钟前
1
0
【最新最全】为 iOS 和 Android 的真机和模拟器编译 Luajit 库

编译 Luajit 库,的确是一个挑战。因为官网的教程,在当前版本的 Xcode 和 NDK 环境中,已经不适用了。以前只是编译了适用于真机的 Luajit 库。最近在尝试编译模拟器 Luajit 库,就顺便梳理了...

ios122
31分钟前
0
0
rsync至ssh同步

rsync: 文件同步工具,可实现“增量拷贝”;使用yum安装rsync包 常用选项:-a=-rtplgoD (-r同步目录,-t保持文件的时间属性,-p保持文件的权限属性,-l保持软连接,-g保持文件的属组,-o保持...

ZHENG-JY
36分钟前
0
0
TradingView 学习笔记

#前言 公司最后需要使用TradingView展示K线图走势。由于之前没接触过,拿到文档时一脸蒙逼。还好找到二篇文章+Demo代码,直接改改就行了。 #被批 由于上面的懵懂,有个问题困扰4个小时没解决...

hihubs
36分钟前
0
0
10.28 rsync工具介绍~10.31 rsync通过ssh同步

rsync命令是一个远程数据同步工具,可通过LAN/WAN快速同步多台主机间的文件。rsync使用所谓的“rsync算法”来使本地和远程两个主机之间的文件达到同步,这个算法只传送两个文件的不同部分,而...

洗香香
39分钟前
1
0
卷积为什么要旋转180度

参考《最容易理解的对卷积(convolution)的解释》 https://blog.csdn.net/bitcarmanlee/article/details/54729807 这篇博客详细讲解了“卷积”,提及了为什么要反转180度,我简述下。 1.卷积的...

datadev_sh
48分钟前
0
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

返回顶部
顶部