-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (33 loc) · 1.3 KB
/
Dockerfile
File metadata and controls
42 lines (33 loc) · 1.3 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
# Use Ubuntu 24.04 as the base image
FROM ubuntu:24.04
LABEL maintainer="Behnam Asadi <behnam.asadi@gmail.com>"
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Berlin
# Update package lists and install essential packages with better error handling
RUN apt-get update --fix-missing && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
lsb-release \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*
# Add Kitware repository for latest cmake
RUN curl -fsSL https://apt.kitware.com/keys/kitware-archive-latest.asc | gpg --dearmor -o /usr/share/keyrings/kitware-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/kitware.list
# Install cmake and other build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends \
cmake \
ninja-build \
build-essential \
git \
doxygen \
graphviz \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Verify that cmake and ninja are installed and available
RUN cmake --version && ninja --version
# Set working directory
WORKDIR /cpp_tutorials