交叉编译debian:jessie container

时间:2018-03-27 14:14:02

标签: docker arm cross-compiling debian-jessie

我正在尝试创建一个用于armhf交叉编译的docker容器。

我一直在https://wiki.debian.org/CrossToolchains关注指南,根据我的理解,下面的Dockerfile就足够了。不幸的是,它找不到gcc-arm-linux-gnueabihf和g ++-arm-linux-gnueabihf依赖项。

FROM debian:jessie

# Install curl so that we can download the keys
RUN apt-get update && apt-get install -y curl

RUN echo "deb http://emdebian.org/tools/debian/ jessie main" > /etc/apt/sources.list.d/crosstools.list
RUN curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add -

RUN dpkg --add-architecture armhf

RUN apt-get update && apt-get install -y cross-gcc-dev
RUN apt-get install -y crossbuild-essential-armhf

BUILD:

sudo docker build .
Sending build context to Docker daemon  113.7kB
Step 1/7 : FROM debian:jessie
 ---> 5dd74d62fab8
Step 2/7 : RUN apt-get update && apt-get install -y curl
 ---> Using cache
 ---> cb5a560dc472
Step 3/7 : RUN echo "deb http://emdebian.org/tools/debian/ jessie main" > /etc/apt/sources.list.d/crosstools.list
 ---> Using cache
 ---> 6674219e5502
Step 4/7 : RUN curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add -
 ---> Using cache
 ---> ce46e0f134a4
Step 5/7 : RUN dpkg --add-architecture armhf
 ---> Using cache
 ---> 88e77df3eb4a
Step 6/7 : RUN apt-get update && apt-get install -y cross-gcc-dev
 ---> Using cache
 ---> 03982cdb62c7
Step 7/7 : RUN apt-get install -y crossbuild-essential-armhf
 ---> Running in 6700f9deb70c
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 crossbuild-essential-armhf : Depends: gcc-arm-linux-gnueabihf (>= 4.9.1-1) but it is not going to be installed
                              Depends: g++-arm-linux-gnueabihf (>= 4.9.1-1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
The command '/bin/sh -c apt-get install -y crossbuild-essential-armhf' returned a non-zero code: 100

有人可以指出我正确的方向吗?我知道还有其他容器已经进行了交叉编译,但对我来说创建自己的容器非常重要。

0 个答案:

没有答案