-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
33 lines (20 loc) · 1.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM --platform=$BUILDPLATFORM golang:alpine AS builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
# Git is required for fetching the dependencies.
RUN apk update && apk add --no-cache git bash libmagic libmagic-static gcc alpine-sdk file-dev && mkdir -p /build/biedatransfer
WORKDIR /build/biedatransfer
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download -json
COPY . .
RUN mkdir -p /app && GOOS=${TARGETPLATFORM%%/*} GOARCH=${TARGETPLATFORM##*/} \
go build -ldflags='-s -w' -o /app/biedatransfer .
# RUN echo "Running on architecture: $(uname -m), BUILDPLATFORM=$BUILDPLATFORM, TARGETPLATFORM=$TARGETPLATFORM" && exit 1
FROM alpine:edge
# add testing repository
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk update && apk add --no-cache libmagic exiftool binwalk ca-certificates
COPY --from=builder /app/biedatransfer /app/biedatransfer
LABEL org.opencontainers.image.description A docker image for the biedatransfer telegram bot.
ENTRYPOINT ["/app/biedatransfer"]