Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用docker编译失败 报这个错误 #10

Open
qq547176052 opened this issue Jan 11, 2025 · 1 comment
Open

使用docker编译失败 报这个错误 #10

qq547176052 opened this issue Jan 11, 2025 · 1 comment

Comments

@qq547176052
Copy link

image

dockerfile

# 设置基础镜像为Ubuntu 18.04
FROM ubuntu:22.04

# 设置作者信息
# MAINTAINER lckfb "service@lckfb.com"
# 修改1这个应该是我的dokcer版本比较新的原因对原命令不支持了
LABEL maintainer="service@lckfb.com"

# 设置环境变量用于非交互式安装
ENV DEBIAN_FRONTEND=noninteractive

# 备份源列表文件
RUN cp -a /etc/apt/sources.list /etc/apt/sources.list.bak

# 将源列表中的 http://.\*ubuntu.com 替换为 http://repo.huaweicloud.com
RUN sed -i 's@http://.\*ubuntu.com@http://repo.huaweicloud.com@g' /etc/apt/sources.list

# 更新包列表
RUN apt update

# 安装基本的编译工具和依赖
RUN apt install -y build-essential crossbuild-essential-arm64 \
 bash-completion vim sudo locales time rsync bc 
# python

RUN apt install -y git ssh make gcc libssl-dev liblz4-tool expect \
g++ patchelf chrpath gawk texinfo chrpath diffstat binfmt-support \
qemu-user-static live-build bison flex fakeroot cmake gcc-multilib \
g++-multilib unzip device-tree-compiler ncurses-dev python2





# 安装其他依赖包这里编译android11sdk需要的环境
# RUN apt install -y repo git ssh libssl-dev liblz4-tool lib32stdc++6 \
#  expect patchelf chrpath gawk texinfo diffstat binfmt-support \
#  qemu-user-static live-build bison flex fakeroot cmake \
#  unzip device-tree-compiler python-pip ncurses-dev python-pyelftools \
#  subversion asciidoc w3m dblatex graphviz python-matplotlib cpio \
#  libparse-yapp-perl default-jre patchutils swig expect-dev u-boot-tools



RUN apt install -y bear

# 再次更新包列表并安装任何未安装的依赖
RUN apt update && apt install -y -f

# 生成本地化语言支持
RUN locale-gen en_US.UTF-8
# 修改2此处缺少了一个等号
#ENV LANG en_US.UTF-8

ENV LANG=en_US.UTF-8

# 创建开发板用户
RUN useradd -c 'lckfb user' -m -d /home/lckfb -s /bin/bash lckfb

# sudo免密登录
RUN sed -i -e '/\%sudo/ c \%sudo ALL=(ALL) NOPASSWD: ALL' /etc/sudoers
RUN usermod -a -G sudo lckfb

#USER lckfb #设置docker工作目录为/home/lckfb
# 修改3命令和注释要分开不然使用这个镜像启动容器时会错
# 报错信息docker: Error response from daemon: unable to find user lckfb #设置docker工作目录为/home/lckfb: no matching entries in passwd file.
# 简单说来就是设置USER的时候把后面的注释也当成了用户名
USER lckfb
#设置docker工作目录为/home/lckfb
WORKDIR /home/lckfb

#容器使用这个内核方法
#docker run --privileged --mount type=bind,source=/home/LCKFB_RK3566/ROCKCHIP_ANDROID11.0_SDK_RELEASE/ROCKCHIP_ANDROID11.0_SDK_RELEASE,target=/home/lckfb/android11 --name="lckfb_android11_sdk" -h lckfb -it lckfb_android11_sdk_cmp

# git clone git@gitee.com:wdbj/tspi-linux-sdk.git

# 编译镜像
# docker build -t lckfb_android11_sdk_cmp1 .
# 运行
# docker run --privileged --mount type=bind,source=E:/linux开发板/泰山派/非官方/挂载,target=/home/lckfb --name="lckfb_android11_sdk1" -h lckfb -it lckfb_android11_sdk_cmp1
@CN-CaoJun
Copy link

老铁,试下这个docker呢
https://hub.docker.com/repository/docker/caojunjun/tspienv/general

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants