Skip to content

Commit

Permalink
updated build-fips to use toolchain builds
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Porter <[email protected]>
  • Loading branch information
portertech committed Dec 14, 2023
1 parent cdbab80 commit bc13c7c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
4 changes: 2 additions & 2 deletions otelcolbuilder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ build-debug: ensure-correct-builder-version

.PHONY: build-fips
build-fips:
docker build --platform linux/amd64 -t otelcol-sumo-builder-fips -f ../ci/build-fips-action/Dockerfile ../ci/build-fips-action
docker run -it --platform linux/amd64 --rm -v $(PWD)/../:/github/workspace -w /github/workspace --tmpfs /tmp otelcol-sumo-builder-fips
docker build --platform linux/amd64 -t otelcol-sumo-builder-fips -f ./build-fips/Dockerfile ./build-fips
docker run -it --platform linux/amd64 --rm -v $(PWD)/../:/root/workspace -w /root/workspace otelcol-sumo-builder-fips

.PHONY: generate-sources
generate-sources:
Expand Down
16 changes: 16 additions & 0 deletions otelcolbuilder/build-fips/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ubuntu:20.04

ARG DEBIAN_VERSION="bullseye"
ARG UBUNTU_VERSION="20.04"
ARG GO_VERSION=1.21.4

RUN apt-get update
RUN apt-get install -y git wget xz-utils build-essential curl

RUN curl -Lo go.tar.gz https://go.dev/dl/go1.21.4.linux-amd64.tar.gz
RUN tar -zxvf go.tar.gz -C /usr/local
ENV PATH="/usr/local/go/bin:${PATH}"

COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
14 changes: 14 additions & 0 deletions otelcolbuilder/build-fips/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env sh

cp -r /root/workspace /root/build
cd /root/build

# Install builder
cd otelcolbuilder || exit 1
mkdir "${HOME}/bin"
export PATH="${HOME}/bin:${PATH}"
make install-builder

# Build otelcol-sumo
make otelcol-sumo-linux-fips_amd64
make otelcol-sumo-linux-fips_arm64

0 comments on commit bc13c7c

Please sign in to comment.