From e09bbc38305dd5aafc668efb3ec811bc69d5038e Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Sat, 8 Feb 2020 13:20:07 -0600 Subject: [PATCH] Initial commit for an ubuntu 18.04 based env that can build the SDK An initial docker image that can be used to create the SDK. The image has a 'buildkite-agent' user and is intended to be kept small. Signed-off-by: Kumar Gala --- Dockerfile | 16 ++++++++++++++++ setup.sh | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 Dockerfile create mode 100755 setup.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e74cd39 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM ubuntu:18.04 + +WORKDIR /sdk-build + +COPY setup.sh . + +RUN ./setup.sh && \ + useradd -m buildkite-agent --shell /bin/bash --uid 2000 && \ + echo 'buildkite-agent ALL = NOPASSWD: ALL' > /etc/sudoers.d/buildkite-agent && \ + chmod 0440 /etc/sudoers.d/buildkite-agent + +# Set the 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 diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..834738e --- /dev/null +++ b/setup.sh @@ -0,0 +1,39 @@ +#!/bin/bash -e + +apt-get clean +apt-get update + +# software-properties for add-apt-repository +# locales for LANG support +# sudo to make life easier when running as build user +# vim.tiny so we have an editor +apt-get install -y --no-install-recommends software-properties-common \ + locales sudo vim.tiny + +# The package sets are based on Yocto & crosstool-ng docs/references: +# +# Yocto: +# https://www.yoctoproject.org/docs/2.3.4/ref-manual/ref-manual.html#ubuntu-packages +# +# crosstool-ng: +# https://github.com/crosstool-ng/crosstool-ng/blob/master/testing/docker/ubuntu18.04/Dockerfile +apt-get install -y --no-install-recommends gcc g++ gperf bison flex texinfo \ + help2man make libncurses5-dev python3-dev autoconf automake libtool \ + libtool-bin gawk wget bzip2 xz-utils unzip patch libstdc++6 diffstat \ + build-essential chrpath socat cpio python python3 \ + python3-pip python3-pexpect debianutils iputils-ping + +# Install python3.8-dev for build w/GDB +apt-get install -y --no-install-recommends python3.8-dev + +# Install packages for creating SDK packages +apt-get install -y --no-install-recommends makeself p7zip-full tree curl + +# Install python packages to allow upload to aws S3 +pip3 install setuptools +pip3 install awscli + +# Grab a new git +add-apt-repository ppa:git-core/ppa -y +apt-get update +apt-get install git -y