700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > docker编译Linux内核 c – 如何编译在docker中使用内核函数的C代...

docker编译Linux内核 c – 如何编译在docker中使用内核函数的C代...

时间:2023-09-15 08:28:14

相关推荐

docker编译Linux内核 c  – 如何编译在docker中使用内核函数的C代...

我有一个Makefile,一些使用PCI设备的C代码

all:

g++ -o executable main.cpp -std=c++11 -O3 -I/usr/include/postgresql -I/usr/include/hiredis -lzmq -lprotobuf -lpthread -lpq -lhiredis

clean:

rm executable

它依赖于使用内核函数的C库.这个libraby的Makefile是

# dist and build are folders, not phony targets

.PHONY: all package clean

all: dragon_pb2.py package

: dragon.proto

protoc --cpp_out=. dragon.proto

dragon_pb2.py: dragon.proto

protoc --python_out=. dragon.proto

package: build

clean:

rm -f dragon.pb.*

rm -f dragon_pb*

rm -rf build

rm -rf dist

rm -f MANIFEST

这是我的Dockerfile

FROM ubuntu:14.04

ENV PG_MAJOR 9.3

RUN apt-get update

RUN apt-get install -y git make protobuf-compiler libhiredis-dev postgresql-server-dev-${PG_MAJOR}

RUN apt-get install -y g++

RUN apt-get install -y libzmq-dev

RUN apt-get install -y libprotobuf-dev

RUN apt-get install -y linux-headers-$(uname -r)

ADD deployment_key /root/.ssh/id_rsa

RUN chmod 600 /root/.ssh/id_rsa

RUN echo "StrictHostKeyChecking no" >> /root/.ssh/config

RUN echo >> /root/.ssh/config

RUN echo "Host " >> /root/.ssh/config

RUN mkdir -p /usr/src/app/

WORKDIR /usr/src/app/

RUN git clone git@:opticsdevelopment/dragon-protocols.git

WORKDIR ./dragon-protocols

RUN make

RUN cp ./dragon.pb.* ../

COPY . /usr/src/app

WORKDIR ../

RUN git clone git@:opticsdevelopment/dragon-module.git

WORKDIR ./dragon-module

RUN make all

WORKDIR ../

RUN make

EXPOSE 5570

CMD ["dragon"]

现在的问题是安装linux-headers.不知怎的,它找不到标题

E: Unable to locate package linux-headers-3.13.0-19-generic

E: Couldn't find any package by regex 'linux-headers-3.13.0-19-generic'

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。