Skip to content

Commit d2174f1

Browse files
mprpicclaude
andauthored
fix: migrate openapi Dockerfile from Docker to UBI (#947)
Replace docker.io/openapitools/openapi-generator-cli with registry.access.redhat.com/ubi9/ubi:9.7. Install Java and Go via dnf and download the openapi-generator JAR directly from Maven Central. Remove unused make, sudo, and Debian-specific Go env vars. Signed-off-by: Martin Prpič <mprpic@redhat.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 44d7e11 commit d2174f1

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

components/ambient-api-server/Dockerfile.openapi

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
FROM docker.io/openapitools/openapi-generator-cli:v7.16.0
1+
FROM registry.access.redhat.com/ubi9/ubi:9.7
22

3-
RUN apt-get update
4-
RUN apt-get install -y make sudo git golang-1.21
3+
# Install Java (to run openapi-generator), Go (for gofmt), and git
4+
RUN dnf install -y java-17-openjdk-headless go-toolset git && dnf clean all
5+
6+
# Download openapi-generator-cli JAR
7+
RUN curl -L -o /usr/local/bin/openapi-generator-cli.jar \
8+
https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar
59

610
RUN mkdir -p /local
711
COPY . /local
812

9-
ENV PATH="/ambient/bin:/usr/lib/go-1.21/bin/:${PATH}"
10-
ENV GOPATH="/ambient"
11-
ENV GOBIN /usr/lib/go-1.21/bin/
12-
ENV CGO_ENABLED=0
13-
1413
WORKDIR /local
1514

16-
RUN bash /usr/local/bin/docker-entrypoint.sh generate -i /local/openapi/openapi.yaml -g go -o /local/pkg/api/openapi
15+
RUN java -jar /usr/local/bin/openapi-generator-cli.jar generate -i /local/openapi/openapi.yaml -g go -o /local/pkg/api/openapi
1716
RUN rm /local/pkg/api/openapi/go.mod /local/pkg/api/openapi/go.sum
1817
RUN rm -rf /local/pkg/api/openapi/test
1918
RUN rm -rf /local/pkg/api/openapi/git_push.sh

0 commit comments

Comments
 (0)