Docker file for running yocto
This commit is contained in:
63
image/Dockerfile
Normal file
63
image/Dockerfile
Normal file
@@ -0,0 +1,63 @@
|
||||
FROM ubuntu:22.04
|
||||
|
||||
# Prevent interactive prompts during package installation
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install Yocto build dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gawk \
|
||||
wget \
|
||||
git \
|
||||
diffstat \
|
||||
unzip \
|
||||
texinfo \
|
||||
gcc \
|
||||
build-essential \
|
||||
chrpath \
|
||||
socat \
|
||||
cpio \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-pexpect \
|
||||
xz-utils \
|
||||
debianutils \
|
||||
iputils-ping \
|
||||
python3-git \
|
||||
python3-jinja2 \
|
||||
python3-subunit \
|
||||
zstd \
|
||||
liblz4-tool \
|
||||
file \
|
||||
locales \
|
||||
libacl1 \
|
||||
sudo \
|
||||
vim \
|
||||
less \
|
||||
tree \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set up locale
|
||||
RUN locale-gen en_US.UTF-8
|
||||
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
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /workspace
|
||||
|
||||
# Change ownership of workspace to yocto user
|
||||
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"
|
||||
|
||||
# Default command to start interactive shell
|
||||
CMD ["/bin/bash"]
|
||||
Reference in New Issue
Block a user