deprecated-oc-catalog/Dockerfile

28 lines
706 B
Docker
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM golang:alpine as builder
WORKDIR /app
COPY . .
RUN go get github.com/beego/bee/v2 && go install github.com/beego/bee/v2@master
# Generating the swagger
RUN timeout 20 bee run -gendoc=true -downdoc=true -runmode=dev || :
RUN sed -i 's/http:\/\/127.0.0.1:8080\/swagger\/swagger.json/swagger.json/g' swagger/index.html
RUN sed -i 's/https:\/\/petstore.swagger.io\/v2\/swagger.json/swagger.json/g' swagger/index.html
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" .
FROM scratch
WORKDIR /app
COPY ./docker_catalog.json /etc/oc/catalog.json
COPY --from=builder /app/oc-catalog /usr/bin/
COPY --from=builder /app/swagger /app/swagger
EXPOSE 8080
ENTRYPOINT ["oc-catalog"]