11# Go Version
2- FROM golang:1.23 .1-bullseye
2+ FROM golang:1.25 .1-bookworm
33
44# Declare build arguments so they're visible inside the Dockerfile
55ARG repo
@@ -13,18 +13,41 @@ RUN set -eux ; apt install -y curl bash linux-headers-amd64 xz-utils jq unzip
1313# Switch into /root
1414WORKDIR /root
1515
16- # Debug: confirm we have the correct values
17- RUN echo "DEBUG: repo=${repo}, branch=${branch} commit_sha=${commit_sha}"
16+ # Debug: confirm we have the correct values and show environment
17+ RUN echo "=== BUILD ARGUMENTS ===" && \
18+ echo "repo=${repo}" && \
19+ echo "branch=${branch}" && \
20+ echo "commit_sha=${commit_sha}" && \
21+ echo "PWD=$(pwd)" && \
22+ echo "=== END BUILD ARGUMENTS ==="
1823
1924# 1) Clone
2025RUN set -eux ; git clone --progress "https://github.com/${repo}.git" /root/trueblocks-core
2126
2227# 2) Move into the cloned repo
2328WORKDIR /root/trueblocks-core
2429
30+ # Debug: Show current directory and contents
31+ RUN echo "=== POST-CLONE DEBUG ===" && \
32+ echo "PWD=$(pwd)" && \
33+ echo "Directory contents:" && \
34+ ls -la && \
35+ echo "Git status:" && \
36+ git status && \
37+ echo "=== END POST-CLONE DEBUG ==="
38+
2539# 3) Check out the desired branch
2640RUN set -eux ; git checkout "${branch}"
2741
42+ # Debug: Show git status after checkout
43+ RUN echo "=== POST-CHECKOUT DEBUG ===" && \
44+ echo "PWD=$(pwd)" && \
45+ echo "Current branch:" && \
46+ git branch && \
47+ echo "Git status:" && \
48+ git status && \
49+ echo "=== END POST-CHECKOUT DEBUG ==="
50+
2851# 4) Update/init submodules
2952RUN set -eux ; git submodule update --init --recursive
3053
@@ -34,14 +57,45 @@ RUN set -eux ; mkdir -v build
3457# 6) Switch into that folder
3558WORKDIR /root/trueblocks-core/build
3659
60+ # Debug: Show build directory setup
61+ RUN echo "=== BUILD DIRECTORY DEBUG ===" && \
62+ echo "PWD=$(pwd)" && \
63+ echo "Build directory contents:" && \
64+ ls -la && \
65+ echo "Parent directory contents:" && \
66+ ls -la ../ && \
67+ echo "scripts directory check:" && \
68+ ls -la ../scripts/ && \
69+ echo "=== END BUILD DIRECTORY DEBUG ==="
70+
3771# 7) Optionally sync go.work modules (if your script does that)
38- RUN set -eux ; ../scripts/go-work-sync.sh
72+ RUN echo "=== RUNNING go-work-sync.sh ===" && \
73+ ../scripts/go-work-sync.sh 2>&1 | tee /tmp/go-work-sync.log && \
74+ echo "=== go-work-sync.sh completed ==="
75+
76+ # 8) Run CMake with better error reporting
77+ RUN echo "=== RUNNING CMAKE ===" && \
78+ cmake ../src 2>&1 | tee /tmp/cmake.log || \
79+ (echo "CMAKE FAILED - Contents of cmake.log:" && cat /tmp/cmake.log && exit 1)
3980
40- # 8) Run CMake
41- RUN set -eux ; cmake ../src
81+ # 9) Run make with verbose output and better error reporting
82+ RUN echo "=== RUNNING MAKE ===" && \
83+ make VERBOSE=1 -j1 2>&1 | tee /tmp/make.log || \
84+ (echo "MAKE FAILED - Last 50 lines of make.log:" && tail -50 /tmp/make.log && exit 1)
4285
43- # 9) Run make (compile)
44- RUN set -eux ; make -j4
86+ # Debug final setup before entrypoint
87+ RUN echo "=== FINAL CONTAINER SETUP ===" && \
88+ echo "Build directory contents:" && \
89+ ls -la && \
90+ echo "Makefile check:" && \
91+ (ls -la Makefile || echo "No Makefile found" ) && \
92+ echo "test-all target check:" && \
93+ (make -n test-all 2>&1 | head -10 || echo "Cannot check test-all target" ) && \
94+ echo "scripts directory:" && \
95+ (ls -la ../scripts/ | head -10 || echo "Cannot list scripts directory" ) && \
96+ echo "build-and-test.sh permissions:" && \
97+ (ls -la ../scripts/build-and-test.sh || echo "Cannot find build-and-test.sh" ) && \
98+ echo "=== END FINAL SETUP ==="
4599
46100# Finally, define your entrypoint (if you want to run tests or something)
47101ENTRYPOINT ["bash" , "/root/trueblocks-core/scripts/build-and-test.sh" ]
0 commit comments