oc-auth/Dockerfile

34 lines
646 B
Docker
Raw Permalink Normal View History

2024-07-26 13:46:05 +02:00
FROM golang:alpine as builder
2024-10-30 12:38:25 +01:00
ARG HOSTNAME=http://localhost
ARG NAME=local
2024-07-26 13:46:05 +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
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-auth /usr/bin/
COPY --from=builder /app/swagger /app/swagger
COPY docker_auth.json /etc/oc/auth.json
EXPOSE 8080
ENTRYPOINT ["oc-auth"]