Commit cfb902d4 authored by Manuel Kieweg's avatar Manuel Kieweg 🤷
Browse files

add race as build arg

parent 876456d2
FROM golang:1.15-alpine AS builder
ARG GITLAB_USER
ARG GITLAB_TOKEN
ARG BUILDARGS
WORKDIR /src/gosdn
COPY . .
RUN apk add git
RUN git config --global url."https://$GITLAB_USER:$GITLAB_TOKEN@code.fbi.h-da.de".insteadOf "https://code.fbi.h-da.de"
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux go build ./cmd/gosdn
RUN CGO_ENABLED=0 GOOS=linux go build $BUILDARGS ./cmd/gosdn
FROM alpine:latest
EXPOSE 8080
......
......@@ -26,6 +26,7 @@ variables:
build:develop:
variables:
TAG: $CI_REGISTRY_IMAGE:develop
BUILDARGS: -race
DOCKERFILE: build/dockerfiles/staging
rules:
- if: $CI_COMMIT_BRANCH == "develop"
......@@ -34,6 +35,7 @@ build:develop:
build:merge-request:
variables:
TAG: $CI_REGISTRY_IMAGE:merge-request
BUILDARGS: -race
DOCKERFILE: build/dockerfiles/staging
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
......
FROM golang:1.15-alpine AS builder
ARG GITLAB_USER
ARG GITLAB_TOKEN
WORKDIR /src/gosdn
COPY . .
RUN apk add git
RUN git config --global url."https://$GITLAB_USER:$GITLAB_TOKEN@code.fbi.h-da.de".insteadOf "https://code.fbi.h-da.de"
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux go build -race ./cmd/gosdn
FROM alpine:latest
EXPOSE 8080
EXPOSE 55055
COPY --from=builder /src/gosdn/gosdn .
COPY --from=builder /src/gosdn/configs ./configs
ENTRYPOINT [ "./gosdn" ]
CMD [""]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment