updated to multistage build, changed to alpine image
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,17 +1,14 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
FROM golang:latest
|
FROM golang:latest AS bunny_build
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN git clone https://github.com/omgdanieltam/BunnyBot.git .
|
RUN git clone https://github.com/omgdanieltam/BunnyBot.git .
|
||||||
|
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ./BunnyBot
|
||||||
|
|
||||||
COPY auth.json ./
|
FROM alpine:latest
|
||||||
|
WORKDIR /app
|
||||||
RUN go build -o ./BunnyBot
|
COPY --from=bunny_build /app/BunnyBot /app/BunnyBot
|
||||||
|
|
||||||
RUN chmod +x ./BunnyBot
|
RUN chmod +x ./BunnyBot
|
||||||
|
COPY auth.json ./
|
||||||
CMD [ "./BunnyBot" ]
|
CMD [ "./BunnyBot" ]
|
||||||
|
Reference in New Issue
Block a user