@@ -1221,6 +1221,106 @@ COPY --from=plucky-build /tmp/google-cloud-ops-agent.tgz /google-cloud-ops-agent
12211221COPY --from=plucky-build /google-cloud-ops-agent*.deb /
12221222COPY --from=plucky-build /google-cloud-ops-agent-plugin*.tar.gz /
12231223
1224+ # ======================================
1225+ # Build Ops Agent for ubuntu-questing
1226+ # ======================================
1227+
1228+ FROM ubuntu:questing AS questing-build-base
1229+ ARG OPENJDK_MAJOR_VERSION
1230+
1231+ RUN set -x; apt-get update && \
1232+ DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \
1233+ autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \
1234+ build-essential cmake bison flex file systemd-dev debhelper libsystemd-dev tzdata \
1235+ devscripts cdbs pkg-config openjdk-${OPENJDK_MAJOR_VERSION}-jdk zip
1236+
1237+ SHELL ["/bin/bash" , "-c" ]
1238+
1239+ # Install golang
1240+ ARG TARGETARCH
1241+ ARG GO_VERSION
1242+ ADD https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz /tmp/go${GO_VERSION}.tar.gz
1243+ RUN set -xe; \
1244+ tar -xf /tmp/go${GO_VERSION}.tar.gz -C /usr/local
1245+ ENV PATH="${PATH}:/usr/local/go/bin"
1246+
1247+
1248+ FROM questing-build-base AS questing-build-otel
1249+ WORKDIR /work
1250+ # Download golang deps
1251+ COPY ./submodules/opentelemetry-operations-collector/go.mod ./submodules/opentelemetry-operations-collector/go.sum submodules/opentelemetry-operations-collector/
1252+ RUN cd submodules/opentelemetry-operations-collector && go mod download
1253+
1254+ COPY ./submodules/opentelemetry-java-contrib submodules/opentelemetry-java-contrib
1255+ # Install gradle. The first invocation of gradlew does this
1256+ RUN cd submodules/opentelemetry-java-contrib && ./gradlew --no-daemon -Djdk.lang.Process.launchMechanism=vfork tasks
1257+ COPY ./submodules/opentelemetry-operations-collector submodules/opentelemetry-operations-collector
1258+ COPY ./builds/otel.sh .
1259+ RUN \
1260+ unset OTEL_TRACES_EXPORTER && \
1261+ unset OTEL_EXPORTER_OTLP_TRACES_ENDPOINT && \
1262+ unset OTEL_EXPORTER_OTLP_TRACES_PROTOCOL && \
1263+ ./otel.sh /work/cache/
1264+
1265+ FROM questing-build-base AS questing-build-fluent-bit
1266+ WORKDIR /work
1267+ COPY ./submodules/fluent-bit submodules/fluent-bit
1268+ COPY ./builds/fluent_bit.sh .
1269+ RUN ./fluent_bit.sh /work/cache/
1270+
1271+
1272+ FROM questing-build-base AS questing-build-systemd
1273+ WORKDIR /work
1274+ COPY ./systemd systemd
1275+ COPY ./builds/systemd.sh .
1276+ RUN ./systemd.sh /work/cache/
1277+
1278+
1279+ FROM questing-build-base AS questing-build-golang-base
1280+ WORKDIR /work
1281+ COPY go.mod go.sum ./
1282+ # Fetch dependencies
1283+ RUN go mod download
1284+ COPY confgenerator confgenerator
1285+ COPY apps apps
1286+ COPY internal internal
1287+
1288+
1289+ FROM questing-build-golang-base AS questing-build-wrapper
1290+ WORKDIR /work
1291+ COPY cmd/agent_wrapper cmd/agent_wrapper
1292+ COPY ./builds/agent_wrapper.sh .
1293+ RUN ./agent_wrapper.sh /work/cache/
1294+
1295+
1296+ FROM questing-build-golang-base AS questing-build
1297+ WORKDIR /work
1298+ COPY . /work
1299+
1300+ # Run the build script once to build the ops agent engine to a cache
1301+ RUN mkdir -p /tmp/cache_run/golang && cp -r . /tmp/cache_run/golang
1302+ WORKDIR /tmp/cache_run/golang
1303+ RUN ./pkg/deb/build.sh &> /dev/null || true
1304+ WORKDIR /work
1305+
1306+ COPY ./confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml
1307+ COPY --from=questing-build-otel /work/cache /work/cache
1308+ COPY --from=questing-build-fluent-bit /work/cache /work/cache
1309+ COPY --from=questing-build-systemd /work/cache /work/cache
1310+ COPY --from=questing-build-wrapper /work/cache /work/cache
1311+ RUN ./pkg/deb/build.sh
1312+
1313+ COPY cmd/ops_agent_uap_plugin cmd/ops_agent_uap_plugin
1314+ COPY ./builds/ops_agent_plugin.sh .
1315+ RUN ./ops_agent_plugin.sh /work/cache/
1316+ RUN ./pkg/plugin/build.sh /work/cache questing
1317+
1318+
1319+ FROM scratch AS questing
1320+ COPY --from=questing-build /tmp/google-cloud-ops-agent.tgz /google-cloud-ops-agent-ubuntu-questing.tgz
1321+ COPY --from=questing-build /google-cloud-ops-agent*.deb /
1322+ COPY --from=questing-build /google-cloud-ops-agent-plugin*.tar.gz /
1323+
12241324FROM scratch
12251325COPY --from=centos8 /* /
12261326COPY --from=rockylinux9 /* /
@@ -1232,4 +1332,5 @@ COPY --from=sles12 /* /
12321332COPY --from=sles15 /* /
12331333COPY --from=jammy /* /
12341334COPY --from=noble /* /
1235- COPY --from=plucky /* /
1335+ COPY --from=plucky /* /
1336+ COPY --from=questing /* /
0 commit comments