Repository navigation
Expand file tree
/
Copy pathDockerfile.dev
More file actions
153 lines (138 loc) · 6.7 KB
/
Copy pathDockerfile.dev
File metadata and controls
153 lines (138 loc) · 6.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# syntax=docker/dockerfile:1
# Monorepo DevContainer image (GPU workstation). Ubuntu 24.04 base matches the
# ROCm LLVM copy (glibc 2.39+) so --config=rocm_offload can run /opt/rocm/llvm/bin/clang++.
# Java 21 (JetBrains Runtime 21) is installed in this Dockerfile at /opt/jetbrains-jbr.
#
# Docker: CLI + compose/buildx plugins talk to the host daemon via
# /var/run/docker.sock (see docker-compose.dev.yml). Rebuild after changing
# DOCKER_GID if `docker ps` fails with permission denied.
#
# Image roles (Engine production images live under OpenBimRL-Engine/):
# llvm.dockerfile — CPU / default clang + libomp
# rocm.dockerfile — AMD ROCm OpenMP offload
# nvcc.dockerfile — NVIDIA CUDA toolkit (offload WIP)
# Dockerfile.dev — this file: local DevContainer with ROCm + IfcOpenShell
#
# Optional: UBUNTU_APT_MIRROR (e.g. http://linux.rub.de/ubuntu/) replaces
# archive.ubuntu.com and security.ubuntu.com in apt sources during build.
ARG UBUNTU_APT_MIRROR
FROM rocm/dev-ubuntu-24.04:7.1.1 AS rocm-llvm
FROM ubuntu:24.04 AS ifcos-build
ARG UBUNTU_APT_MIRROR
ARG IFCOPENSHELL_GIT_TAG=eafa158ca0cd5ba2ca22b5e588b0375cab2efbce
RUN if [ -n "${UBUNTU_APT_MIRROR}" ]; then \
find /etc/apt -maxdepth 2 \( -name 'sources.list' -o -name '*.list' -o -name '*.sources' \) -type f \
| while read -r f; do \
sed -i \
-e "s|http://archive.ubuntu.com/ubuntu|${UBUNTU_APT_MIRROR}|g" \
-e "s|http://security.ubuntu.com/ubuntu|${UBUNTU_APT_MIRROR}|g" \
-e "s|https://archive.ubuntu.com/ubuntu|${UBUNTU_APT_MIRROR}|g" \
-e "s|https://security.ubuntu.com/ubuntu|${UBUNTU_APT_MIRROR}|g" \
"$f"; \
done; \
fi \
&& apt-get update && apt-get install -y --no-install-recommends \
ca-certificates git cmake ninja-build \
clang libomp-dev \
libboost-all-dev \
libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev \
libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \
libhdf5-dev libeigen3-dev libgmp-dev libmpfr-dev libxml2-dev \
&& rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/IfcOpenShell/IfcOpenShell.git /src \
&& cd /src \
&& git checkout "${IFCOPENSHELL_GIT_TAG}"
RUN cmake -G Ninja -S /src/cmake -B /build \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_INSTALL_PREFIX=/opt/ifcopenshell \
-DCMAKE_BUILD_TYPE=Release \
-DOCC_INCLUDE_DIR=/usr/include/opencascade \
-DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DBUILD_SHARED_LIBS=ON \
-DSCHEMA_VERSIONS="2x3;4;4x3_add2" \
-DBUILD_CONVERT=OFF \
-DBUILD_IFCPYTHON=OFF \
-DBUILD_GEOMSERVER=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_DOCUMENTATION=OFF \
-DWITH_CGAL=OFF \
-DCOLLADA_SUPPORT=OFF \
-DHDF5_SUPPORT=OFF \
-DGLTF_SUPPORT=OFF \
-DIFCXML_SUPPORT=OFF \
-DUSD_SUPPORT=OFF \
&& cmake --build /build -j"$(nproc)" \
&& cmake --install /build
# Java 21 (JetBrains Runtime for JNI headers + alignment with IntelliJ tooling).
FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04
USER root
ARG UBUNTU_APT_MIRROR
ARG JBR_VERSION=21.0.11
ARG JBR_BUILD=b1163.116
ARG ENABLE_ROCM_OFFLOAD=OFF
ARG ROCM_OFFLOAD_ARCH=
# Host docker.sock group (override via docker-compose build.args / DOCKER_GID env).
ARG DOCKER_GID=999
COPY --from=rocm-llvm /opt/rocm-7.1.1/ /opt/rocm/
COPY --from=ifcos-build /opt/ifcopenshell /opt/ifcopenshell
RUN if [ -n "${UBUNTU_APT_MIRROR}" ]; then \
find /etc/apt -maxdepth 2 \( -name 'sources.list' -o -name '*.list' -o -name '*.sources' \) -type f \
| while read -r f; do \
sed -i \
-e "s|http://archive.ubuntu.com/ubuntu|${UBUNTU_APT_MIRROR}|g" \
-e "s|http://security.ubuntu.com/ubuntu|${UBUNTU_APT_MIRROR}|g" \
-e "s|https://archive.ubuntu.com/ubuntu|${UBUNTU_APT_MIRROR}|g" \
-e "s|https://security.ubuntu.com/ubuntu|${UBUNTU_APT_MIRROR}|g" \
"$f"; \
done; \
fi \
&& rm -f /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates curl git inotify-tools \
make cmake ninja-build ccache \
clang libomp-dev libomp5 clangd-18 \
xfonts-scalable \
libocct-data-exchange-dev libocct-draw-dev libocct-foundation-dev \
libocct-modeling-algorithms-dev libocct-modeling-data-dev \
libocct-ocaf-dev libocct-visualization-dev \
libmpfr-dev libboost-all-dev libhdf5-dev libgmp-dev libxml2-dev libeigen3-dev \
nodejs npm \
lldb-18 \
&& npm install -g pnpm@9.15.9 \
&& curl -fsSL "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-${JBR_VERSION}-linux-x64-${JBR_BUILD}.tar.gz" \
| tar -xz -C /opt \
&& mv /opt/jbrsdk-* /opt/jetbrains-jbr-21 \
&& ln -sfn /opt/jetbrains-jbr-21 /opt/jetbrains-jbr \
&& ln -sf /usr/bin/lldb-dap-18 /usr/bin/lldb-dap \
&& ln -sf /usr/bin/lldb-18 /usr/bin/lldb \
&& ln -sf /usr/bin/clangd-18 /usr/bin/clangd \
&& install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc \
&& chmod a+r /etc/apt/keyrings/docker.asc \
&& echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu noble stable" \
> /etc/apt/sources.list.d/docker.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
docker-ce-cli docker-compose-plugin docker-buildx-plugin \
&& ln -sf /opt/rocm/llvm/bin/clang /usr/local/bin/rocm-clang \
&& ln -sf /opt/rocm/llvm/bin/clang++ /usr/local/bin/rocm-clang++ \
&& (getent group docker >/dev/null 2>&1 && groupmod -g "${DOCKER_GID}" docker || groupadd -g "${DOCKER_GID}" docker) \
&& usermod -aG docker vscode \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Kotlin LS: installed via devcontainer.json (JetBrains.kotlin-server from Marketplace). Engine/native .bazelrc pin /usr/bin/clang
# CreatorTool webapp uses pnpm@9.15.9 (see OpenBimRL-CreatorTool/webapp/package.json packageManager).
# for default Bazel builds (same as llvm.dockerfile). Use --config=rocm_offload
# (and OPENBIMRL_ROCM_OFFLOAD_ARCH) for AMD offload.
ENV ROCM_PATH=/opt/rocm
ENV PATH=${ROCM_PATH}/llvm/bin:${PATH}
ENV CC=/usr/bin/clang
ENV CXX=/usr/bin/clang++
ENV OPENBIMRL_ENABLE_ROCM_OFFLOAD=${ENABLE_ROCM_OFFLOAD}
ENV OPENBIMRL_ROCM_OFFLOAD_ARCH=${ROCM_OFFLOAD_ARCH}
ENV OPENBIMRL_USE_PREBUILT_IFCOPENSHELL=ON
ENV OPENBIMRL_IFCOPENSHELL_PREFIX=/opt/ifcopenshell
ENV JAVA_HOME=/opt/jetbrains-jbr
USER vscode