Skip to content

Commit

Permalink
Merge pull request #1956 from axsaucedo/1955_fix_openapi_docker_permi…
Browse files Browse the repository at this point in the history
…ssions

Changed OpenAPI file permissions within image
  • Loading branch information
axsaucedo authored Jun 16, 2020
2 parents 6bd3963 + c59eae5 commit 1d96a67
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion executor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ 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
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"]
8 changes: 8 additions & 0 deletions executor/Dockerfile.redhat
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand All @@ -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"]
2 changes: 1 addition & 1 deletion executor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d96a67

Please sign in to comment.