[PATCH phosphor-event v2 1/3] Add a script to build inside Docker
OpenBMC Patches
openbmc-patches at stwcx.xyz
Thu Feb 18 17:00:28 AEDT 2016
From: Joel Stanley <joel at jms.id.au>
This allows phosphor-event to be on a machine with Docker installed
that does not have all the dependencies installed.
A docker container is built and used for the build process, with the
binary built in-place.
Signed-off-by: Joel Stanley <joel at jms.id.au>
---
.build.sh | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100755 .build.sh
diff --git a/.build.sh b/.build.sh
new file mode 100755
index 0000000..0be2e19
--- /dev/null
+++ b/.build.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -ex
+
+Dockerfile=$(cat << EOF
+FROM ubuntu:15.10
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get upgrade -yy
+RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -yy \
+ make gcc g++ libsystemd-dev libc6-dev pkg-config
+RUN groupadd -g ${GROUPS} ${USER} && useradd -d ${HOME} -m -u ${UID} -g ${GROUPS} ${USER}
+USER ${USER}
+ENV HOME ${HOME}
+EOF
+)
+
+docker pull ubuntu:15.10
+docker build -t openbmc/phosphor-event - <<< "${Dockerfile}"
+
+gcc --version
+
+docker run --rm=true --user="${USER}" \
+ -w "${PWD}" -v "${HOME}":"${HOME}" openbmc/phosphor-event make
--
2.7.1
More information about the openbmc
mailing list