oc-catalog/Dockerfile

33 lines
653 B
Docker
Raw Normal View History

FROM golang:alpine AS builder
2024-07-26 13:07:25 +02:00
WORKDIR /app
COPY . .
RUN apk add git
RUN go get github.com/beego/bee/v2 && go install github.com/beego/bee/v2@master
2024-07-31 16:08:41 +02:00
RUN go get cloud.o-forge.io/core/oc-lib
2024-07-26 13:07:25 +02:00
RUN timeout 15 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 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" .
RUN ls /app
FROM scratch
WORKDIR /app
COPY --from=builder /app/oc-catalog /usr/bin/
COPY --from=builder /app/swagger /app/swagger
COPY docker_catalog.json /etc/oc/catalog.json
EXPOSE 8080
ENTRYPOINT ["oc-catalog"]