File tree Expand file tree Collapse file tree 2 files changed +22
-18
lines changed
Expand file tree Collapse file tree 2 files changed +22
-18
lines changed Original file line number Diff line number Diff line change 2121 - name : Build the Docker image
2222 run : docker build . --file Dockerfile --tag mycpp_image:latest
2323
24+ # Step 2.5: Verify Docker image and cmake availability
25+ - name : Verify Docker image
26+ run : |
27+ docker run --rm mycpp_image:latest which cmake
28+ docker run --rm mycpp_image:latest which ninja
29+ docker run --rm mycpp_image:latest cmake --version
30+ docker run --rm mycpp_image:latest ninja --version
31+
2432 # Step 3: Configure CMake
2533 - name : Configure CMake
2634 run : docker run --rm -v ${{ github.workspace }}:/cpp_tutorials mycpp_image:latest cmake -S /cpp_tutorials -G "Ninja Multi-Config" -B /cpp_tutorials/build
Original file line number Diff line number Diff line change 1- # Use Ubuntu 24.04 as the base image
2- FROM ubuntu:24.04
1+ # Use a pre-built image with cmake and build tools to avoid package repository issues
2+ FROM ubuntu/cmake:latest
33
44LABEL maintainer="Behnam Asadi <behnam.asadi@gmail.com>"
55
@@ -8,21 +8,17 @@ ENV DEBIAN_FRONTEND=noninteractive
88ENV TZ=Europe/Berlin
99RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
1010
11- # Install required packages with retry logic and better error handling
12- RUN --mount=type=cache,target=/var/cache/apt \
13- for i in $(seq 1 3); do \
14- apt-get update --fix-missing && \
15- apt-get install -y --no-install-recommends \
16- git \
17- cmake \
18- ninja-build \
19- doxygen \
20- build-essential \
21- graphviz \
22- ca-certificates \
23- && break || sleep 10; \
24- done && \
25- apt-get clean && \
26- rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
11+ # Install additional required packages that aren't in the base image
12+ RUN apt-get update && apt-get install -y --no-install-recommends \
13+ doxygen \
14+ graphviz \
15+ && apt-get clean \
16+ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
17+
18+ # Verify that cmake and ninja are installed and available
19+ RUN cmake --version && ninja --version
20+
21+ # Set working directory
22+ WORKDIR /cpp_tutorials
2723
2824
You can’t perform that action at this time.
0 commit comments