diff --git a/executor/Dockerfile b/executor/Dockerfile index 32a72a4044..065b19727b 100644 --- a/executor/Dockerfile +++ b/executor/Dockerfile @@ -20,6 +20,10 @@ COPY k8s/ k8s/ # Build RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o executor main.go +# Copy OpenAPI folder and change the permissions +COPY api/rest/openapi/ /openapi/ +RUN chmod -R 660 /openapi/ + # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details FROM gcr.io/distroless/static:latest @@ -27,6 +31,6 @@ WORKDIR / COPY --from=builder /workspace/executor . COPY licenses/license.txt licenses/license.txt # Copy openapi spec and swagger UI files -COPY api/rest/openapi/ /openapi/ +COPY --from=builder /openapi/ /openapi/ ENTRYPOINT ["/executor"] diff --git a/executor/Dockerfile.redhat b/executor/Dockerfile.redhat index 8d893314bf..d505fd4029 100644 --- a/executor/Dockerfile.redhat +++ b/executor/Dockerfile.redhat @@ -20,6 +20,10 @@ COPY k8s/ k8s/ # Build RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o executor main.go +# Copy OpenAPI folder and change the permissions +COPY api/rest/openapi/ /openapi/ +RUN chmod -R 660 /openapi/ + FROM registry.access.redhat.com/ubi8/ubi-minimal LABEL name="Seldon Executor" \ vendor="Seldon Technologies" \ @@ -31,4 +35,8 @@ LABEL name="Seldon Executor" \ WORKDIR / COPY --from=builder /workspace/executor . COPY licenses/license.txt licenses/license.txt + +# Copy openapi spec and swagger UI files +COPY --from=builder /openapi/ /openapi/ + ENTRYPOINT ["/executor"] diff --git a/executor/Makefile b/executor/Makefile index d3298ded84..8749764708 100644 --- a/executor/Makefile +++ b/executor/Makefile @@ -70,7 +70,7 @@ docker-build: test copy_openapi_resources docker build -f Dockerfile -t ${IMG} . # Build the docker image for Redhat -docker-build-redhat: test copy-openapi-resources +docker-build-redhat: test copy_openapi_resources docker build . -f Dockerfile.redhat -t ${IMG_REDHAT} # Push the docker image