Skip to content

Instantly share code, notes, and snippets.

@datsuns
Created August 9, 2024 09:08
Show Gist options
  • Save datsuns/136f94f3f32b6ef861cd9b66fc6305f3 to your computer and use it in GitHub Desktop.
Save datsuns/136f94f3f32b6ef861cd9b66fc6305f3 to your computer and use it in GitHub Desktop.
V2H docker
FROM ubuntu:20.04
ARG input=/tmp
ARG user=user
ARG git_email="you@example.com"
ARG git_name="Your Name"
ENV HOME=/home/${user}
ENV WORK=${HOME}/ai_sdk_work
ENV YOCTO_WORK=${WORK}/src_setup/yocto
RUN \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
unzip gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping libsdl1.2-dev xterm p7zip-full libyaml-dev \
libssl-dev vim locales
RUN locale-gen en_US en_US.UTF-8 && \
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \
export LANG=en_US.UTF-8
RUN useradd -ms /bin/bash ${user}
USER ${user}
RUN \
git config --global user.email ${git_email} && \
git config --global user.name ${git_name}
COPY ${input}/RTK0EF0180F03000SJ_linux-src.zip ${WORK}/
WORKDIR ${WORK}/src_setup
RUN unzip ${WORK}/RTK0EF0180F*_linux-src.zip -d ${WORK}/src_setup
WORKDIR ${YOCTO_WORK}
RUN tar zxvf ${WORK}/src_setup/rzv2h_ai-sdk_yocto_recipe_v*.tar.gz
RUN \
wget https://github.com/renesas-rz/rzv_ai_sdk/releases/download/v3.00/0001-recipes-debian-buster-glibc-Update-version-from-2.28.patch &&\
wget https://github.com/renesas-rz/rzv_ai_sdk/releases/download/v3.00/0001-rz-common-recipes-debian-buster-glibc-update-to-v2.28-10+deb10u4.patch &&\
wget https://github.com/renesas-rz/rzv_ai_sdk/releases/download/v3.00/61835_update_url_gst_common.patch
WORKDIR ${YOCTO_WORK}/meta-renesas
RUN patch -p1 < ../0001-recipes-debian-buster-glibc-Update-version-from-2.28.patch
RUN patch -p1 < ../0001-rz-common-recipes-debian-buster-glibc-update-to-v2.28-10+deb10u4.patch
RUN patch -d ${YOCTO_WORK}/meta-rz-features/meta-rz-codecs -p1 < ${YOCTO_WORK}/61835_update_url_gst_common.patch
WORKDIR ${YOCTO_WORK}
RUN \
echo "TEMPLATECONF=${PWD}/meta-renesas/meta-rzv2h/docs/template/conf/ source poky/oe-init-build-env" > /tmp/setup.sh && \
echo "bitbake-layers add-layer ../meta-rz-features/meta-rz-graphics" >> /tmp/setup.sh && \
echo "bitbake-layers add-layer ../meta-rz-features/meta-rz-drpai" >> /tmp/setup.sh && \
echo "bitbake-layers add-layer ../meta-rz-features/meta-rz-opencva" >> /tmp/setup.sh && \
echo "bitbake-layers add-layer ../meta-rz-features/meta-rz-codecs" >> /tmp/setup.sh && \
echo "patch -p1 < ../0001-tesseract.patch" >> /tmp/setup.sh
RUN /bin/bash /tmp/setup.sh
WORKDIR ${YOCTO_WORK}
# TEMPLATECONF=${PWD}/meta-renesas/meta-rzv2h/docs/template/conf/ source poky/oe-init-build-env
# MACHINE=rzv2h-evk-ver1 bitbake core-image-weston
IMAGE := v2h_base
INPUT_DIR := ./_input
default: build finish
build:
docker build -f Dockerfile -t $(IMAGE) --build-arg input=${INPUT_DIR} ./
run1:
docker run -e=DISPLAY --net=host --rm --name $@ -it $(IMAGE) /bin/bash --login
run2:
docker run -e=DISPLAY --net=host --rm --name $@ -it $(IMAGE) /bin/bash --login
finish:
docker image ls
docker system df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment