Dockerfiles/nanopb.dockerfile
2024-04-04 00:00:20 +08:00

20 lines
829 B
Docker

FROM ubuntu:22.04
LABEL maintainer 168062547@qq.com
ENV DEBIAN_FRONTEND=noninteractive
RUN sed -i "s@http://.*archive.ubuntu.com@http://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list && \
sed -i "s@http://.*security.ubuntu.com@http://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list && \
dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y wget libc6:i386 libstdc++6:i386
RUN cd /opt && \
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.3.9.3-linux-x86.tar.gz && \
tar xvf nanopb-0.3.9.3-linux-x86.tar.gz && \
rm nanopb-0.3.9.3-linux-x86.tar.gz
ENV PATH="${PATH}:/opt/nanopb-0.3.9.3-linux-x86/generator-bin"
# docker build -f nanopb.dockerfile -t nanopb:0.3.9.3 .
# docker run --rm -v .:/app -w /app nanopb:0.3.9.3 protoc --nanopb_out=./ PacketModel_all.proto