Skip to content

Commit 972d4a3

Browse files
committed
fix(opa): Manually install Go version
NOTE: The dnf package was 1.23.6 and OPA required 1.23.8 NOTE: I tried making the version paramaterized, but bake wouldn't allow it (it worked fine with `docker build` and `docker build xbuild`).
1 parent 3499ae4 commit 972d4a3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ All notable changes to this project will be documented in this file.
5757
- Add `--locked` flag to `cargo install` commands for reproducible builds ([#1044]).
5858
- nifi: reduce docker image size by removing the recursive chown/chmods in the final image ([#1027]).
5959
- opa: reduce docker image size by removing the recursive chown/chmods in the final image ([#1038]).
60+
- opa: Manually install Go 1.23.9 ([#1103]).
6061
- spark-k8s: reduce docker image size by removing the recursive chown/chmods in the final image ([#1042]).
6162
- trino: reduce docker image size by removing the recursive chown/chmods in the final image ([#1025]).
6263
- zookeeper: reduce docker image size by removing the recursive chown/chmods in the final image ([#1043]).

opa/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,21 @@ ENV GOOS=$TARGETOS
4747

4848
# gzip, tar - used to unpack the OPA source
4949
# git - needed by the cyclonedx-gomod tool to determine the version of OPA
50-
# golang - used to build OPA
5150
RUN <<EOF
5251
microdnf update
5352
microdnf install \
5453
git \
55-
golang \
5654
gzip \
5755
tar
5856
microdnf clean all
5957
EOF
6058

6159
COPY --chown=${STACKABLE_USER_UID}:0 opa/stackable/bin /stackable/opa/bin
6260

61+
# Manually install Go since the dnf package is sometimes not recent enough
62+
COPY --from=registry-1.docker.io/library/golang:1.23.9 /usr/local/go/ /usr/local/go/
63+
ENV PATH="/usr/local/go/bin:${PATH}"
64+
6365
RUN <<EOF
6466
# We use version 1.7.0, since a newer version of cyclonedx-gomod is not compatible with the version of Golang (>= 1.23.1)
6567
go install github.com/CycloneDX/cyclonedx-gomod/cmd/[email protected]

0 commit comments

Comments
 (0)