Add build scripts and dockerfile
parent
5d40cde0c8
commit
11d703efcb
@ -0,0 +1,22 @@
|
||||
# ---- Base ----
|
||||
FROM alpine:3 AS base
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
# ---- Build ----
|
||||
FROM golang:1.19-alpine AS build
|
||||
WORKDIR /build
|
||||
# Copy sources
|
||||
ADD . .
|
||||
# Get dependencies
|
||||
RUN go get ./cmd/app
|
||||
# Compile
|
||||
RUN CGO_ENABLED=0 go build -a -o app ./cmd/app
|
||||
|
||||
|
||||
# ---- Release ----
|
||||
FROM base AS release
|
||||
# Copy build-target
|
||||
COPY --from=build /build/app .
|
||||
|
||||
CMD ["./app"]
|
@ -0,0 +1,9 @@
|
||||
TAG="ruakij/routingtabletowg"
|
||||
PLATFORM="linux/amd64,linux/arm64/v8,linux/arm/v7"
|
||||
EXTRA_ARGS="$@"
|
||||
|
||||
docker buildx build \
|
||||
--platform $PLATFORM \
|
||||
--tag $TAG \
|
||||
$EXTRA_ARGS
|
||||
.
|
@ -0,0 +1,7 @@
|
||||
TAG="ruakij/routingtabletowg"
|
||||
EXTRA_ARGS="$@"
|
||||
|
||||
docker build \
|
||||
--tag $TAG \
|
||||
$EXTRA_ARGS \
|
||||
.
|
Loading…
Reference in New Issue