Skip to content
Snippets Groups Projects
Commit 66bc4a63 authored by Malte Bauch's avatar Malte Bauch
Browse files

Fix: Dockerfile

parent 27550785
Branches
No related tags found
1 merge request!5Fix: Dockerfile
Pipeline #179805 failed
ARG GOLANG_VERSION=1.21
ARG BUILDARGS
ARG ACCESS_TOKEN_USR="nothing"
ARG ACCESS_TOKEN_PWD="nothing"
FROM golang:$GOLANG_VERSION-bookworm as builder
ARG GITLAB_LOGIN
ARG GITLAB_TOKEN
WORKDIR /ekms/
COPY . .
# based on https://jwenz723.medium.com/fetching-private-go-modules-during-docker-build-5b76aa690280
RUN printf "machine code.fbi.h-da.de\n\
login ${ACCESS_TOKEN_USR}\n\
password ${ACCESS_TOKEN_PWD}\n\
\n"\
>> /root/.netrc
RUN chmod 600 /root/.netrc
RUN echo "machine code.fbi.h-da.de login ${GITLAB_LOGIN} password ${GITLAB_TOKEN}" > ~/.netrc
RUN --mount=type=cache,target=/root/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
make build
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment