Improved yocto directory structure

This commit is contained in:
2025-07-02 17:40:59 +02:00
parent 60fd0a02f8
commit f30d31a24f
12 changed files with 988 additions and 99 deletions

View File

@@ -42,9 +42,15 @@ ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
# Create non-root user for Yocto builds (Yocto doesn't like running as root)
RUN useradd -m -s /bin/bash yocto && \
echo "yocto ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# Create build user matching host UID/GID
ARG USER_ID=1000
ARG GROUP_ID=1000
RUN groupadd -g ${GROUP_ID} builder && \
useradd -u ${USER_ID} -g ${GROUP_ID} -ms /bin/bash builder
# Enable compiler cache for performance
ENV USE_CCACHE=1
ENV CCACHE_DIR=/workspace/.ccache
# Set working directory
WORKDIR /workspace
@@ -53,11 +59,7 @@ WORKDIR /workspace
RUN chown -R yocto:yocto /workspace
# Switch to yocto user
USER yocto
# Set up git configuration (required for Yocto)
RUN git config --global user.name "Yocto Builder" && \
git config --global user.email "yocto@builder.local"
USER builder
# Default command to start interactive shell
CMD ["/bin/bash"]