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

Add a Dockerfile and gitignore

parent f292ca2f
Branches
Tags
1 merge request!8Create a monorepo for ekms and quantumlayer
artifacts
artifacts
ARG GOLANG_VERSION=1.21
ARG BUILDARGS
ARG ACCESS_TOKEN_USR="nothing"
ARG ACCESS_TOKEN_PWD="nothing"
FROM ${GITLAB_PROXY}golang:$GOLANG_VERSION-bookworm as builder
WORKDIR /quantumlayer/
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 --mount=type=cache,target=/root/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
make build
FROM ${GITLAB_PROXY}golang:$GOLANG_VERSION-bookworm
WORKDIR /app/
COPY --from=builder /quantumlayer/artifacts/quantumlayer ./quantumlayer
ENTRYPOINT ["./quantumlayer"]
Makefile 0 → 100644
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
GOPATH := $(~/go)
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
BUILD_ARTIFACTS_PATH=artifacts
all: build
pre:
mkdir -p $(BUILD_ARTIFACTS_PATH)
build: pre
$(GOBUILD) -o $(BUILD_ARTIFACTS_PATH)/quantumlayer ./example/main.go
container: build
docker buildx build --rm -t quantumlayer --load -f ./Dockerfile .
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment