Skip to content

Commit 439f799

Browse files
committed
Update buildenv-generator-ubuntu docker to 2025-10-16 with Go 1.25
Also add docker-build.sh, print-versions.sh, versions.md
1 parent 6c796ec commit 439f799

File tree

5 files changed

+175
-23
lines changed

5 files changed

+175
-23
lines changed

.gitlab-ci.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,25 @@
1111
extends: [ .build ]
1212
tags: [ x64, linux, docker ]
1313
image:
14-
name: objectboxio/buildenv-generator-ubuntu:2024-02-26
14+
# For available go versions, check ci/docker/versions.md
15+
name: objectboxio/buildenv-generator-ubuntu:2025-10-16
1516
pull_policy: [if-not-present]
1617

17-
# Available go versions in objectboxio/buildenv-generator-ubuntu:2024-02-26:
18-
#
19-
# Version | Location (GOROOT) | Notes
20-
# ------- | --------------------- | -------------------------------------------------
21-
# 1.18.1 | /usr/lib/go-1.18 | (Ubuntu 22.04 package)
22-
# 1.22.0 | /usr/local/go1.22 | Manual installed version (default first on PATH)
23-
# 1.19.13 | /root/sdk/go1.19.13 | Additional version installed via go install
24-
2518
bt:linux-x64:go1.18:
2619
extends: [ .build-linux ]
2720
before_script:
2821
- export PATH=/usr/lib/go-1.18/bin:$PATH
2922

30-
bt:linux-x64:go1.19:
23+
# Second-latest go version
24+
bt:linux-x64:go1.24:
3125
extends: [ .build-linux ]
3226
before_script:
33-
- export PATH=/root/sdk/go1.19.13/bin:$PATH
27+
- export PATH=/usr/local/go1.24.9/bin:$PATH
3428

35-
bt:linux-x64:go1.22:
29+
# Latest go version
30+
bt:linux-x64:go1.25:
3631
extends: [ .build-linux ]
3732
after_script:
38-
- apt-get update
39-
- apt-get install -y zip
4033
- zip objectbox-generator-Linux.zip objectbox-generator
4134
artifacts:
4235
expire_in: 1 day

ci/docker/Dockerfile.ubuntu

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1+
# Not using the latest LTS version to depend only on the second latest C and C++ libraries for the C/C++ builds.
2+
# TODO Or does this not matter as we do a full static build including the C and C++ libraries?
13
FROM ubuntu:22.04
24
RUN apt-get update && \
35
apt-get install -y make cmake golang git curl ccache zip && \
46
apt-get clean && \
57
rm -rf /var/lib/apt/lists/*
68

7-
# Installation of additional go versions from ubuntu's go1.18 via
8-
# go install golang.org/dl/go1.19.13@latest
9-
# fails with
10-
# [...]/version.go:537:38: undefined: signalsToIgnore
11-
# Thus, installation of a recent go version manually and add older versions afterwards
9+
# Install the newest Go version manually and make it the default
10+
RUN curl -sS -L --fail https://go.dev/dl/go1.25.3.linux-amd64.tar.gz | tar xz -v --one-top-level=go1.25 --strip-components 1 -C /usr/local
11+
ENV PATH=/root/go/bin:/usr/local/go1.25/bin:$PATH
1212

13-
RUN curl -sS -L --fail https://go.dev/dl/go1.22.0.linux-amd64.tar.gz | tar xz -v --one-top-level=go1.22 --strip-components 1 -C /usr/local
14-
ENV PATH=/root/go/bin:/usr/local/go1.22/bin:$PATH
13+
# Also install the second newest Go version
14+
RUN curl -sS -L --fail https://go.dev/dl/go1.24.9.linux-amd64.tar.gz | tar xz -v --one-top-level=go1.24.9 --strip-components 1 -C /usr/local
1515

16-
RUN go install golang.org/dl/go1.19.13@latest
17-
RUN go1.19.13 download
16+
# Utilities to display versions from within the container
17+
COPY print-versions.sh /print-versions.sh
18+
RUN chmod +x /print-versions.sh

ci/docker/docker-build.sh

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Usage: ./docker-build.sh [--version YYYY-MM-DD] [--push] [--push-existing] [--run]
5+
# Note: order of arguments matters
6+
# Builds the Docker image from Dockerfile.ubuntu in this directory.
7+
8+
# Parse args
9+
version=$(date +%Y-%m-%d)
10+
do_push=false
11+
do_build=true
12+
do_run=false
13+
14+
if [ "${1:-}" == "--version" ]; then
15+
version=$2
16+
shift 2
17+
fi
18+
19+
if [ "${1:-}" == "--push" ]; then
20+
do_push=true
21+
shift
22+
fi
23+
24+
if [ "${1:-}" == "--push-existing" ]; then
25+
do_push=true
26+
do_build=false
27+
shift
28+
fi
29+
30+
# Start an interactive bash session in the image
31+
if [ "${1:-}" == "--run" ]; then
32+
do_run=true
33+
shift
34+
fi
35+
36+
# Image name
37+
repository=objectboxio/buildenv-generator-ubuntu
38+
full_name=$repository:$version
39+
40+
echo "------------------------------------------------------------------------"
41+
echo " Image name: $full_name"
42+
echo " Version: $version"
43+
echo " Dockerfile: Dockerfile.ubuntu"
44+
echo "------------------------------------------------------------------------"
45+
46+
if [ "$do_build" = true ]; then
47+
echo "Building \"$full_name\"..."
48+
docker build --tag "$full_name" \
49+
--build-arg version="$version" \
50+
--progress=plain \
51+
-f Dockerfile.ubuntu \
52+
.
53+
echo "Built \"$full_name\""
54+
if [ -f "./print-versions.sh" ]; then
55+
docker run --rm "$full_name" /print-versions.sh || true
56+
else
57+
docker run --rm "$full_name" cat /versions.txt || true
58+
fi
59+
docker image ls "$full_name"
60+
fi
61+
62+
# Run an interactive shell in the image if requested
63+
if [ "$do_run" = true ]; then
64+
echo "Starting interactive bash in \"$full_name\" (temporary container)..."
65+
docker run --rm -it "$full_name" bash
66+
fi
67+
68+
if [ "$do_push" = true ]; then
69+
echo "Pushing \"$full_name\"..."
70+
docker push "$full_name"
71+
echo "Pushed \"$full_name\""
72+
fi
73+
74+
# Print Docker version so we can copy it for documentation
75+
docker --version

ci/docker/print-versions.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
echo "=== Environment ==="
5+
uname -a || true
6+
echo "PATH=$PATH"
7+
8+
echo
9+
echo "=== Go versions (system installed first) ==="
10+
echo "which: /usr/bin/go"
11+
/usr/bin/go version || true
12+
13+
# Custom (manual) installs
14+
for go_custom_install in /usr/local/go*/bin/go; do
15+
if [ -x "$go_custom_install" ]; then
16+
echo "which: $go_custom_install"
17+
"$go_custom_install" version || true
18+
fi
19+
done
20+
21+
# Also list Go toolchains installed via `go install golang.org/dl/...` (e.g., /root/go/bin/go1.24.9)
22+
for go_dl_tool in /root/go/bin/go1.*; do
23+
if [ -x "$go_dl_tool" ]; then
24+
echo "which: $go_dl_tool"
25+
"$go_dl_tool" version || true
26+
fi
27+
done
28+
29+
echo
30+
echo "=== Compiler, libs & Tools ==="
31+
lib_dir="/usr/lib/x86_64-linux-gnu"
32+
"$lib_dir/libc.so.6" | grep "GLIBC"
33+
strings "$lib_dir/libstdc++.so.6" | grep GLIBCXX_3 | head -1
34+
strings "$lib_dir/libstdc++.so.6" | grep GLIBCXX_3 | tail -1
35+
which gcc
36+
gcc --version | grep gcc
37+
which ld
38+
ld --version | grep "ld"
39+
cmake --version | grep version
40+
make --version | grep Make
41+
ccache --version | grep "ccache version"

ci/docker/versions.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
BuildEnv Docker versions
2+
========================
3+
These are the versions of objectboxio/buildenv-generator-ubuntu-* images.
4+
Note: for each version, please indicate the primary motivation(s) that led to creating the version.
5+
6+
objectboxio/buildenv-generator-ubuntu:2025-10-16
7+
------------------------------------------------
8+
Update to the latest Go version for the upcoming 5.0 release.
9+
10+
```
11+
=== Go versions (system installed first) ===
12+
which: /usr/bin/go
13+
go version go1.18.1 linux/amd64
14+
which: /usr/local/go1.24.9/bin/go
15+
go version go1.24.9 linux/amd64
16+
which: /usr/local/go1.25/bin/go
17+
go version go1.25.3 linux/amd64
18+
19+
=== Compiler, libs & Tools ===
20+
GNU C Library (Ubuntu GLIBC 2.35-0ubuntu3.11) stable release version 2.35.
21+
GLIBCXX_3.4
22+
GLIBCXX_3.4.30
23+
/usr/bin/gcc
24+
gcc (Ubuntu 11.4.0-1ubuntu1~22.04.2) 11.4.0
25+
/usr/bin/ld
26+
GNU ld (GNU Binutils for Ubuntu) 2.38
27+
cmake version 3.22.1
28+
GNU Make 4.3
29+
ccache version 4.5.1
30+
31+
REPOSITORY TAG IMAGE ID CREATED SIZE
32+
objectboxio/buildenv-generator-ubuntu 2025-10-16 538e75e5d488 1 second ago 1.34GB
33+
```
34+
35+
objectboxio/buildenv-generator-ubuntu:2024-02-26
36+
------------------------------------------------
37+
38+
| Version | Location (GOROOT) | Notes |
39+
|---------|---------------------|--------------------------------------------------|
40+
| 1.18.1 | /usr/lib/go-1.18 | (Ubuntu 22.04 package) |
41+
| 1.22.0 | /usr/local/go1.22 | Manual installed version (default first on PATH) |
42+
| 1.19.13 | /root/sdk/go1.19.13 | Additional version installed via go install |

0 commit comments

Comments
 (0)