将二进制文件添加到docker中

时间:2018-06-14 03:05:03

标签: docker dockerfile

我试图将二进制文件添加到docker镜像中。

这是我的泊坞文件。

FROM ALPINE
ADD gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2 /

我建立,

$ sudo docker build -t test1 .
Sending build context to Docker daemon  99.86MB
Step 1/2 : FROM alpine
latest: Pulling from library/alpine
ff3a5c916c92: Pull complete 
Digest: sha256:e1871801d30885a610511c867de0d6baca7ed4e6a2573d506bbec7fd3b03873f
Status: Downloaded newer image for alpine:latest
 ---> 3fd9065eaf02
Step 2/2 : ADD gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2 /
 ---> 1c64eaf65019
Successfully built 1c64eaf65019
Successfully tagged test1:latest

然后我跑,

$ sudo docker run -i -t test1
/ # ls
bin                                gcc-arm-none-eabi-7-2017-q4-major  media                              root                               srv                                usr
dev                                home                               mnt                                run                                sys                                var
etc                                lib                                proc                               sbin                               tmp
/ # cd gcc-arm-none-eabi-7-2017-q4-major/
/gcc-arm-none-eabi-7-2017-q4-major # ls
arm-none-eabi  bin            lib            share
/gcc-arm-none-eabi-7-2017-q4-major # cd bin
/gcc-arm-none-eabi-7-2017-q4-major/bin # ls
arm-none-eabi-addr2line   arm-none-eabi-c++filt     arm-none-eabi-gcc         arm-none-eabi-gcc-ranlib  arm-none-eabi-gdb         arm-none-eabi-ld.bfd      arm-none-eabi-ranlib      arm-none-eabi-strip
arm-none-eabi-ar          arm-none-eabi-cpp         arm-none-eabi-gcc-7.2.1   arm-none-eabi-gcov        arm-none-eabi-gdb-py      arm-none-eabi-nm          arm-none-eabi-readelf
arm-none-eabi-as          arm-none-eabi-elfedit     arm-none-eabi-gcc-ar      arm-none-eabi-gcov-dump   arm-none-eabi-gprof       arm-none-eabi-objcopy     arm-none-eabi-size
arm-none-eabi-c++         arm-none-eabi-g++         arm-none-eabi-gcc-nm      arm-none-eabi-gcov-tool   arm-none-eabi-ld          arm-none-eabi-objdump     arm-none-eabi-strings
/gcc-arm-none-eabi-7-2017-q4-major/bin # ./arm-none-eabi-gcc 123
/bin/sh: ./arm-none-eabi-gcc: not found
/gcc-arm-none-eabi-7-2017-q4-major/bin # ./arm-none-eabi-gcc
/bin/sh: ./arm-none-eabi-gcc: not found
/gcc-arm-none-eabi-7-2017-q4-major/bin #

从上面可以看出,它表示“未找到”'但它显然是存在的。

有谁知道做这种事的正确方法?

我的计划是为这个嵌入式平台添加一堆用C编写的驱动程序,并使用docker容器作为独立的开发环境。

谢谢!

2 个答案:

答案 0 :(得分:0)

二进制文件用于ubuntu 16.04,更改为:

function myFunction() {

    var res = URLFetchApp.fetch("https://www.bitmex.com/api/v1/tradesymbol=.BVOL&");
    var content = res.getContentText();
    Logger.log(res);
    Logger.log(content);

}

答案 1 :(得分:0)

未找到""存在的二进制文件上的错误通常意味着您在容器内部缺少链接库。您可以使用ldd arm-none-eabi-gcc找出您缺少的库。对于阿尔卑斯山,它通常是自由的,因为他们使用musl。