summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-07-22 16:34:40 +0300
committerAdam Stankiewicz <sheerun@sher.pl>2020-08-01 11:26:52 +0300
commit30c58d581606b4484757e6ee9133c248de1514a6 (patch)
tree718076fe0c98200fe386dc5186a4aecd787c2f67
parent5a806649ec187926be5829f42f8f18606a3d4e75 (diff)
downloadbmcweb-30c58d581606b4484757e6ee9133c248de1514a6.tar.xz
Add ability to build via docker
Change-Id: I241d260209090dc4a01a96449657b270649d6643 Signed-off-by: Adam Stankiewicz <sheerun@sher.pl>
-rw-r--r--.dockerignore6
-rw-r--r--Dockerfile11
-rw-r--r--Dockerfile.base15
-rwxr-xr-xbuild_x86_docker.sh17
4 files changed, 49 insertions, 0 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000000..09213f9993
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,6 @@
+.git
+Dockerfile
+Dockerfile.base
+.dockerignore
+build
+
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000000..978a4c31a9
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,11 @@
+# Please build bmcweb-base first with
+# docker build --no-cache --force-rm -t bmcweb-base -f Dockerfile.base .
+FROM bmcweb-base
+
+ADD . /source
+
+RUN cmake --build .
+
+RUN mkdir -p /usr/share/www
+
+CMD ["/build/bmcweb"]
diff --git a/Dockerfile.base b/Dockerfile.base
new file mode 100644
index 0000000000..ca12ab7cce
--- /dev/null
+++ b/Dockerfile.base
@@ -0,0 +1,15 @@
+FROM ubuntu:20.04
+
+RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
+ apt-get install -y libpam0g-dev libssl-dev zlib1g-dev pkg-config xxd cmake \
+ libgtest-dev libgmock-dev ninja-build python3 autoconf-archive autoconf \
+ build-essential git libsystemd-dev systemd python3-wheel python3-pip \
+ python3-yaml python3-mako python3-inflection python3-setuptools && \
+ pip3 install meson
+
+ADD . /source
+
+RUN mkdir -p /build && cd /build && cmake -DYOCTO_DEPENDENCIES=OFF /source && \
+ cmake --build . && rm -rf /source
+
+WORKDIR /build
diff --git a/build_x86_docker.sh b/build_x86_docker.sh
new file mode 100755
index 0000000000..0fb2f503b2
--- /dev/null
+++ b/build_x86_docker.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+if ! command -v docker > /dev/null; then
+ echo "Please install docker from https://www.docker.com/products/docker-desktop"
+ exit 1
+fi
+
+docker inspect bmcweb-base > /dev/null ||
+ docker build --no-cache --force-rm -t bmcweb-base -f Dockerfile.base .
+
+docker build -t bmcweb .
+
+mkdir -p build
+
+docker run -v $PWD:/app -it bmcweb cp -r /build/bmcweb /build/webtest /app/build