Skip to content

Commit 3324c91

Browse files
committed
Add support for running CBMC in a Docker container.
Add a Dockerfile that allows CBMC to be built and run in a Docker container. The Dockerfile is setup in a way that allows multi-stage builds, so that it's built in one container, and then the build artifacts are being copied in another.
1 parent c50c69d commit 3324c91

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM ubuntu:20.04 as builder
2+
ENV DEBIAN_FRONTEND noninteractive
3+
ENV DEBCONF_NONINTERACTIVE_SEEN true
4+
RUN echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
5+
echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections; \
6+
apt-get update && apt-get upgrade -y && apt-get install --no-install-recommends -y \
7+
cmake \
8+
ninja-build \
9+
gcc \
10+
g++ \
11+
maven \
12+
flex \
13+
bison \
14+
libxml2-utils \
15+
dpkg-dev
16+
COPY . /tmp/cbmc
17+
WORKDIR /tmp/cbmc
18+
RUN cmake -S . -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ && cd build; ninja -j2
19+
20+
FROM ubuntu:20.04 as runner
21+
COPY --from=builder /tmp/cbmc/build/bin/* /usr/local/bin/
22+
WORKDIR /tmp/cbmc/
23+
RUN apt-get update && apt-get install -y gcc

0 commit comments

Comments
 (0)