Skip to content

Commit d8c12c4

Browse files
authored
Add Debian-based static builder images. (#311)
1 parent d614008 commit d8c12c4

File tree

3 files changed

+88
-15
lines changed

3 files changed

+88
-15
lines changed

.github/data/matrices.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ anchors:
1414
static:
1515
image: static-builder
1616
revisions:
17-
- v1
18-
platforms:
19-
- linux/amd64
20-
- linux/386
21-
- linux/arm/v6
22-
- linux/arm/v7
23-
- linux/arm64/v8
24-
- linux/ppc64le
17+
v1:
18+
- linux/amd64
19+
- linux/386
20+
- linux/arm/v6
21+
- linux/arm/v7
22+
- linux/arm64/v8
23+
- linux/ppc64le
24+
v2:
25+
- linux/amd64
26+
- linux/arm/v5
27+
- linux/arm/v7
28+
- linux/arm64/v8
29+
- linux/ppc64le
2530
base:
2631
images:
2732
- base

.github/scripts/gen-matrix-static.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,29 @@
2323
'revision': rev,
2424
})
2525
case 'pr':
26-
for rev in static['revisions']:
27-
for platform in [x for x in static['platforms'] if x != meta['native-platform']]:
26+
for rev, platforms in static['revisions'].items():
27+
for platform in [x for x in platforms if x != meta['native-platform']]:
2828
entries.append({
2929
'revision': rev,
3030
'platform': platform,
3131
})
3232
case 'publish':
33-
for rev in static['revisions']:
33+
for rev, platforms in static['revisions'].items():
3434
tags = []
3535

3636
for registry in meta['registries']:
37-
tags.append(f'{ registry }{ meta["image-prefix"] }{ static["image"] }:{ rev }')
37+
tags.append(f'{registry}{meta["image-prefix"]}{static["image"]}:{rev}')
3838

3939
if rev == meta['latest-rev']:
40-
tags.append(f'{ registry }{ meta["image-prefix"] }{ static["image"] }:latest')
40+
tags.append(f'{registry}{meta["image-prefix"]}{static["image"]}:latest')
4141

4242
entries.append({
4343
'revision': rev,
44-
'platforms': ','.join(static['platforms']),
44+
'platforms': ','.join(platforms),
4545
'tags': ','.join(tags)
4646
})
4747
case _:
48-
raise ValueError(f'Unrecognized matrix type { sys.argv[1] }')
48+
raise ValueError(f'Unrecognized matrix type {sys.argv[1]}')
4949

5050
entries.sort(key=lambda k: k['revision'])
5151
matrix = json.dumps({'include': entries}, sort_keys=True)

static-builder/Dockerfile.v2

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
FROM debian:trixie
2+
3+
LABEL org.opencontainers.image.authors="Netdatabot <bot@netdata.cloud>"
4+
LABEL org.opencontainers.image.source="https://github.com/netdata/helper-images"
5+
LABEL org.opencontainers.image.title="Netdata Agent Static Builder Image"
6+
LABEL org.opencontainers.image.description="Builder image for creating static builds of the Netdata Agent"
7+
LABEL org.opencontainers.image.vendor="Netdata Inc."
8+
9+
ENV DEBIAN_FRONTEND=noninteractive
10+
11+
RUN apt-get update && \
12+
apt-get upgrade -y && \
13+
apt-get install -y --no-install-recommends \
14+
autoconf \
15+
automake \
16+
autopoint \
17+
bison \
18+
build-essential \
19+
ca-certificates \
20+
cmake \
21+
curl \
22+
dpkg-dev \
23+
file \
24+
flex \
25+
g++ \
26+
gawk \
27+
gcc \
28+
git-core \
29+
jq \
30+
libatomic1 \
31+
libbrotli-dev \
32+
libcurl4-openssl-dev \
33+
libdistro-info-perl \
34+
libidn2-dev \
35+
libjson-c-dev \
36+
libyaml-dev \
37+
libjudy-dev \
38+
liblz4-dev \
39+
libpcre2-dev \
40+
libprotobuf-dev \
41+
libprotoc-dev \
42+
libreadline-dev \
43+
libsnappy-dev \
44+
libsystemd-dev \
45+
libssl-dev \
46+
libtool \
47+
libunwind-dev \
48+
libuv1-dev \
49+
libzstd-dev \
50+
make \
51+
netcat-openbsd \
52+
ninja-build \
53+
patch \
54+
pkg-config \
55+
protobuf-compiler \
56+
uuid-dev \
57+
wget \
58+
zlib1g-dev && \
59+
apt-get clean && \
60+
c_rehash && \
61+
rm -rf /var/lib/apt/lists/*
62+
63+
ENV PATH="/usr/local/go/bin:${PATH}"
64+
ADD https://raw.githubusercontent.com/netdata/netdata/master/packaging/check-for-go-toolchain.sh /tmp/check-for-go-toolchain.sh
65+
RUN . /tmp/check-for-go-toolchain.sh && \
66+
if ! ensure_go_toolchain; then \
67+
echo "ERROR: ${GOLANG_FAILURE_REASON}" && exit 1 ; \
68+
fi

0 commit comments

Comments
 (0)