Skip to content

Commit

Permalink
Add ability to build via docker
Browse files Browse the repository at this point in the history
Change-Id: I241d260209090dc4a01a96449657b270649d6643
Signed-off-by: Adam Stankiewicz <sheerun@sher.pl>
  • Loading branch information
sheerun committed Aug 1, 2020
1 parent 5a80664 commit 30c58d5
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
Dockerfile
Dockerfile.base
.dockerignore
build

11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
15 changes: 15 additions & 0 deletions Dockerfile.base
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions build_x86_docker.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 30c58d5

Please sign in to comment.