This commit is contained in:
parent
3e16b9e480
commit
29f906c94e
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
FROM golang:alpine AS builder
|
||||||
|
ARG TARGETPLATFORM=no-set
|
||||||
|
ARG version=not-set
|
||||||
|
ARG SHORTSHA=not-set
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
# https://stackoverflow.com/questions/70369368/check-architecture-in-dockerfile-to-get-amd-arm
|
||||||
|
RUN go build -o bin/ddns \
|
||||||
|
-ldflags "-X main.Shortsha=${SHORTSHA} \
|
||||||
|
-X main.Version=${version} \
|
||||||
|
-X main.Aarch=${TARGETPLATFORM}" ./cmd
|
||||||
|
|
||||||
|
FROM alpine AS runner
|
||||||
|
COPY --from=builder /app/bin/ddns /usr/bin/
|
||||||
|
ENTRYPOINT /usr/bin/ddns
|
||||||
4
compose.yaml
Normal file
4
compose.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
services:
|
||||||
|
ddns:
|
||||||
|
image: ddns
|
||||||
|
env_file: ".env"
|
||||||
Loading…
x
Reference in New Issue
Block a user