导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页

    使用Docker 编译 Tina-Linux

    MR Series
    1
    1
    906
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • KunYi
      KunYi LV 8 最后由 KunYi 编辑

      Docker image 使用Ubuntu 18.04 当基底
      目前验证D1-H NeZha Tina-Linux v2.x 编译正常
      原则上应该也能编译A133
      git config 要在主机 环境先设定
      build docker image 会直接使用它

      Dockerfile 內容

      FROM ubuntu:18.04
      ARG userid
      ARG groupid
      ARG username
      
      RUN apt-get update && apt-get install -y \
          build-essential cvs subversion mercurial git-core \
          libncurses5-dev zlib1g-dev gawk flex quilt openssl libssl-dev \
          xsltproc libxml-parser-perl bzr ecj unzip \
          lib32z1 lib32z1-dev libc6-i386 lib32ncurses5 \
          lib32stdc++6 libstdc++6 rsync vim wget curl bc busybox \
          linux-tools-common gperf && \
          apt-get clean && \
          rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
      
      RUN curl -o /usr/local/bin/repo https://storage.googleapis.com/git-repo-downloads/repo \
       && chmod a+x /usr/local/bin/repo
      
      RUN groupadd -g $groupid $username \
       && useradd -m -u $userid -g $groupid $username \
       && echo $username >/root/username \
       && echo "export USER="$username >>/home/$username/.gitconfig
      
      COPY gitconfig /home/$username/.gitconfig
      
      RUN chown $userid:$groupid /home/$username/.gitconfig
      
      ENV HOME=/home/$username
      ENV USER=$username
      ENV WORKFOLDER=/home/$username
      
      ENTRYPOINT chroot --userspec=$(cat /root/username):$(cat /root/username) / /bin/bash -c "cd $WORKFOLDER && exec /bin/bash -i"
      
      

      编译这个Dockerfile 我使用下面指令

      #!/bin/bash
      
      cp ~/.gitconfig ./gitconfig
      docker build --build-arg userid=$(id -u) --build-arg groupid=$(id -g) --build-arg username=$(id -un) --tag allwinner-tina:latest .
      

      然后在下载好的源代码目录建立一个执行的 script 叫做 entrycontainer.sh
      内容如下

      #!/bin/bash
      
      WORKSPACE=$PWD
      docker run --privileged \
      	--interactive \
      	--tty \
              --rm \
      	--volume=/tmp:/tmp \
      	--volume=${WORKSPACE}:/tina \
      	--env WORKFOLDER=/tina \
      	--hostname tina-build \
      	allwinner-tina:latest
      
      

      使用方式如下图

      Screenshot from 2023-07-18 14-47-27.png
      Screenshot from 2023-07-18 14-49-09.png

      1 条回复 最后回复 回复 引用 分享 0
      • 1 / 1
      • First post
        Last post

      Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

      行为准则 | 用户协议 | 隐私权政策