Skip to content

Commit

Permalink
Update docker instructions to use Ubuntu 22.04 (#2594)
Browse files Browse the repository at this point in the history
This updates the docker instructions to build using a base image of
Ubuntu 22.04 rather than 18.04 which no longer builds.  This fixes

Signed-off-by: Ed Beroset <[email protected]>
  • Loading branch information
beroset authored Jan 24, 2024
1 parent 16602b7 commit 2b0d041
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions docs/user-guide/installation/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,43 @@

## Dockerfile

This `Dockerfile` will build and install HELICS in Ubuntu 18.04 with
This `Dockerfile` will build and install HELICS in Ubuntu 22.04 with
Python support.

```dockerfile
FROM ubuntu:18.04 as builder
FROM ubuntu:22.04 as builder

WORKDIR /root/develop

RUN apt update && apt install -y \
libboost-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-test-dev \
libzmq5-dev python3-dev \
libboost-all-dev \
build-essential swig cmake git

WORKDIR /root/develop

RUN git clone https://github.com/GMLC-TDC/HELICS.git helics
RUN git clone --recurse-submodules \
https://github.com/GMLC-TDC/HELICS.git helics

WORKDIR /root/develop/helics/build
WORKDIR /root/develop/helics

RUN cmake \
-DCMAKE_INSTALL_PREFIX=/helics \
..
RUN make -j8 && make install
-DCMAKE_BUILD_TYPE=Release \
-B build

FROM ubuntu:18.04
RUN cmake --build build -j -t install

RUN apt update && apt install -y --no-install-recommends \
libboost-filesystem1.65.1 libboost-program-options1.65.1 \
libboost-test1.65.1 libzmq5

FROM ubuntu:22.04

COPY --from=builder /helics /usr/local/

ENV PYTHONPATH /usr/local/python

# Python must be installed after the PYTHONPATH is set above for it to
# recognize and import libhelicsSharedLib.so.
RUN apt install -y --no-install-recommends python3-dev \
&& rm -rf /var/lib/apt/lists/*
RUN apt update && apt install -y --no-install-recommends \
libboost-filesystem1.74.0 libboost-program-options1.74.0 \
libboost-test1.74.0 libzmq5 pip python3-dev

RUN pip install helics

Expand Down

0 comments on commit 2b0d041

Please sign in to comment.