Skip to content
Snippets Groups Projects
Dockerfile 720 B
Newer Older
  • Learn to ignore specific revisions
  • FROM golang:1.16-buster AS installer
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    ARG GITLAB_USER
    ARG GITLAB_TOKEN
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    ARG BUILDARGS
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    RUN apt-get update && apt-get install -y git
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    RUN git config --global url."https://$GITLAB_USER:$GITLAB_TOKEN@code.fbi.h-da.de".insteadOf "https://code.fbi.h-da.de"
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    RUN go env -w GOPRIVATE=code.fbi.h-da.de/*
    
    
    WORKDIR /src/gosdn
    COPY go.* ./
    RUN go mod download
    
    FROM installer as builder
    
    
    COPY *.go ./
    
    COPY ./api ./api
    COPY ./cmd ./cmd
    COPY ./forks ./forks
    COPY ./interfaces ./interfaces
    COPY ./northbound ./northbound
    COPY ./nucleus ./nucleus
    
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    RUN GOOS=linux go build $BUILDARGS ./cmd/gosdn
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    FROM debian:latest
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    EXPOSE 8080
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    EXPOSE 55055
    COPY --from=builder /src/gosdn/gosdn .
    
    COPY ./configs ./configs
    
    Manuel Kieweg's avatar
    Manuel Kieweg committed
    
    ENTRYPOINT [ "./gosdn" ]
    CMD [""]