Skip to content

Commit

Permalink
Initial Build Environment for Yocto Build in Docker container
Browse files Browse the repository at this point in the history
For GitHub self-hosted CI actions

Signed-off-by: Alex J Lennon <[email protected]>
  • Loading branch information
ajlennon committed Jan 30, 2022
0 parents commit 7437ce9
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
55 changes: 55 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#docker build . -t yocto-ci-build
#docker run -it --rm -v${PWD}:/home/build/yocto yocto-ci-build
FROM ubuntu:16.04

ENV DEBIAN_FRONTENV noninteractive
ENV TERM=linux

RUN apt-get update --fix-missing && apt-get -y upgrade

# Required Packages for the Host Development System
# http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#required-packages-for-the-host-development-system
RUN apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib g++-multilib \
build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
apt-utils tmux xz-utils debianutils iputils-ping libncurses5-dev vim

# Additional recommended packages
RUN apt-get install -y coreutils python2.7 libsdl1.2-dev xterm libssl-dev libelf-dev \
android-tools-fsutils ca-certificates repo whiptail # openjdk-11-jre

# Additional host packages required by poky/scripts/wic
RUN apt-get install -y curl dosfstools mtools parted syslinux tree zip

RUN apt-get install -y nano

# Create a non-root user that will perform the actual build
RUN id github 2>/dev/null || useradd --uid 1000 --create-home github
RUN apt-get install -y sudo
RUN echo "github ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers

# Fix error "Please use a locale setting which supports utf-8."
# See https://wiki.yoctoproject.org/wiki/TipsAndTricks/ResolvingLocaleIssues
RUN apt-get install -y locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8

RUN update-alternatives --install /bin/sh sh /bin/bash 100

ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

USER github
WORKDIR /home/github

# Setup a default git user for clone/checkout
RUN git config --global user.email "[email protected]"
RUN git config --global user.name "yocto"
RUN git config --global http.postBuffer 20k
RUN git config --global url."https://github.com/".insteadOf git://github.com/

CMD "/bin/bash"

#EOF
2 changes: 2 additions & 0 deletions build-docker-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

docker build . --tag dynamicdevices/yocto-ci-build

0 comments on commit 7437ce9

Please sign in to comment.