Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: build-env: add a simplified build container #31

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions build-env/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ubuntu:18.04

ARG ZSDK_VERSION=0.11.2

# install packages toolchain:
ADD install-prereqs.sh /root/install-prereqs.sh
RUN /root/install-prereqs.sh && rm /root/install-prereqs.sh

ENV ZEPHYR_TOOLCHAIN_VARIANT=zephyr
ENV ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-${ZSDK_VERSION}
ENV PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig

WORKDIR /workdir
66 changes: 66 additions & 0 deletions build-env/install-prereqs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/usr/bin/env bash

set -o errexit
set -o pipefail
set -o nounset

ZSDK_VERSION=0.11.2

# install prerequisite packages:
dpkg --add-architecture i386

apt-get update && apt-get upgrade -y

DEBIAN_FRONTEND=noniteractive apt-get install -y --no-install-recommends \
ca-certificates \
ccache \
cmake \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why install cmake here when you later on get it directly from kitware?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, I was scaling back the already existing tooling which may have had it?

In any event, I wasn't aware what's installed from kitware.

device-tree-compiler \
dfu-util \
file \
gcc \
gcc-multilib \
git \
gnupg \
g++-multilib \
gperf \
libsdl2-dev \
make \
ninja-build \
python3-dev \
python3-pip \
python3-setuptools \
python3-tk \
python3-wheel \
wget \
xz-utils

# install the latest CMake:
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add -
sh -c "echo 'deb https://apt.kitware.com/ubuntu/ bionic main' > /etc/apt/sources.list.d/cmake.list"

apt update && apt-get install -y cmake

# install west:
pip3 install -U west

# install Zephyr SDK:
wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/zephyr-sdk-${ZSDK_VERSION}-setup.run" && \
sh "zephyr-sdk-${ZSDK_VERSION}-setup.run" --quiet -- -d /opt/toolchains/zephyr-sdk-${ZSDK_VERSION} && \
rm "zephyr-sdk-${ZSDK_VERSION}-setup.run"

#
# Grab any other python dependencies. TODO: should we pull a particular version, instead of master?
#
REQTS_URL="https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/master/scripts"
for file in requirements requirements-base requirements-build-test requirements-doc requirements-run-test requirements-extras
do
wget -q "$REQTS_URL"/"$file".txt
done

pip3 install -r requirements.txt

for file in requirements requirements-base requirements-build-test requirements-doc requirements-run-test requirements-extras
do
rm "$file".txt
done
File renamed without changes.
File renamed without changes.