forked from itfactory-tm/thomas-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.james
28 lines (18 loc) · 927 Bytes
/
Dockerfile.james
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
FROM --platform=$BUILDPLATFORM golang:1.16-alpine as build
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN apk add --no-cache git
COPY ./ /go/src/github.com/itfactory-tm/thomas-bot
WORKDIR /go/src/github.com/itfactory-tm/thomas-bot
RUN export GOARM=6 && \
export GOARCH=amd64 && \
if [ "$TARGETPLATFORM" == "linux/arm64" ]; then export GOARCH=arm64; fi && \
if [ "$TARGETPLATFORM" == "linux/arm" ]; then export GOARCH=arm; fi && \
go build -ldflags "-X main.revision=$(git rev-parse --short HEAD)" ./cmd/james/
FROM alpine:3.13
RUN apk add --no-cache ca-certificates
RUN mkdir -p /go/src/github.com/itfactory-tm/thomas-bot/thomas-bot
WORKDIR /go/src/github.com/itfactory-tm/thomas-bot/thomas-bot
COPY --from=build /go/src/github.com/itfactory-tm/thomas-bot/james /usr/local/bin/
COPY ./config-bob.json /go/src/github.com/itfactory-tm/thomas-bot/thomas-bot/config.json
CMD [ "/usr/local/bin/james", "serve" ]