通过将RF24库嵌入docker镜像中来构建

时间:2019-03-07 10:45:43

标签: docker

我想将RF24库嵌入docker映像中。 为此,我在Dockerfile中添加了以下语句:

FROM arm32v7/node:10

RUN mkdir -p /home/node
WORKDIR /home/node

COPY package*.json ./

USER root

RUN apt-get update -y && apt-get install -y sudo git

RUN git clone https://github.com/nRF24/RF24.git
RUN cd RF24 && make && sudo make install

RUN npm install

EXPOSE 3000
CMD ["npm","start"]

但是,当我在Raspberry pi3上执行docker构建时,我注意到发生以下错误。

[Running configure]
[SECTION] Detecting arm compilation environment.
  [OK] arm-linux-gnueabihf-gcc detected.
  [OK] arm-linux-gnueabihf-g++ detected.
[SECTION] Detecting target machine.
[OK] machine detected: SoC=BCM2835, Type=unknown, CPU=armv7l.
[SECTION] Detecting DRIVER
  [OK] DRIVER detected:RPi.
[SECTION] Detecting OS.
  [INFO] OS detected:LINUX.
[SECTION] Preparing configuration.
[SECTION] Saving configuration.
[OK] Finished.
arm-linux-gnueabihf-g++ -fPIC -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -Ofast -Wall -pthread  -c RF24.cpp
In file included from /usr/include/stdio.h:935:0,
                 from utility/RPi/RF24_arch_config.h:8,
                 from utility/includes.h:7,
                 from RF24_config.h:43,
                 from RF24.cpp:10:
/usr/include/arm-linux-gnueabihf/bits/stdio.h: In function 'int vprintf(const char*, __gnuc_va_list)':
/usr/include/arm-linux-gnueabihf/bits/stdio.h:36:56: sorry, unimplemented: Thumb-1 hard-float VFP ABI
 vprintf (const char *__restrict __fmt, _G_va_list __arg)
                                                        ^
Makefile:42: recipe for target 'RF24.o' failed

奇怪的是,我没有使用Docker,
当我直接在bash shell中键入命令时,会得到不同的结果

输入如下

cd ~
git clone https://github.com/nRF24/RF24.git
cd RF24 && make && sudo make install

这是结果

[Running configure]
[SECTION] Detecting arm compilation environment.
  [OK] arm-linux-gnueabihf-gcc detected.
  [OK] arm-linux-gnueabihf-g++ detected.
[SECTION] Detecting target machine.
./configure: line 66: warning: command substitution: ignored null byte in input
[OK] machine detected: SoC=BCM2835, Type=RPi, CPU=armv7l.
[SECTION] Detecting DRIVER
  [OK] DRIVER detected:RPi.
[SECTION] Detecting OS.
  [INFO] OS detected:LINUX.
[SECTION] Preparing configuration.
[SECTION] Saving configuration.
[OK] Finished.
arm-linux-gnueabihf-g++ -fPIC -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -Ofast -Wall -pthread  -c RF24.cpp
arm-linux-gnueabihf-g++ -fPIC -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -Ofast -Wall -pthread  -c utility/RPi/spi.cpp
arm-linux-gnueabihf-gcc -fPIC -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -Ofast -Wall -pthread  -c utility/RPi/bcm2835.c
arm-linux-gnueabihf-g++ -fPIC -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -Ofast -Wall -pthread  -c utility/RPi/interrupt.c
[Linking]
arm-linux-gnueabihf-gcc -shared -Wl,-soname,librf24.so.1 -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -Ofast -Wall -pthread  -o librf24.so.1.3.1 RF24.o spi.o bcm2835.o interrupt.o -pthread

我对这个结果感到困惑。 有人请帮助我。

0 个答案:

没有答案