Fix compilation, environment, git repo and command errors
This commit is contained in:
parent
0810154e4b
commit
2d6d9c3959
16
dockerfile
16
dockerfile
|
@ -1,13 +1,15 @@
|
||||||
FROM debian:12-slim AS builder
|
FROM synt/musl-cross-make AS builder
|
||||||
|
|
||||||
ADD url /app/
|
ARG GO_VERSION=1.23.0
|
||||||
|
|
||||||
|
ADD https://fg.q0s.de/null31/irc_bot.git /app
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apt update && apt upgrade -y && apt install musl musl-dev && \
|
ENV CGO_ENABLED=1 CC=x86_64-linux-musl-gcc GOOS=linux GOARCH=amd64 PATH=$PATH:/musl-cross-make/output/bin:/usr/local/go/bin
|
||||||
git clone https://github.com/richfelker/musl-cross-make.git && \
|
|
||||||
cd musl-cross-make && make && make install && cd .. && \
|
RUN wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz && tar -zxf go${GO_VERSION}.linux-amd64.tar.gz -C /usr/local && \
|
||||||
CGO_ENABLED=1 CC=musl-gcc GOOS=linux GOARCH=amd64 go build -a -ldflags '-extldflags "-static"' -o irc_bot
|
go build -a -ldflags '-extldflags "-static"' -o irc_bot
|
||||||
|
|
||||||
FROM alpine:3.20
|
FROM alpine:3.20
|
||||||
|
|
||||||
|
@ -15,4 +17,4 @@ WORKDIR /app
|
||||||
|
|
||||||
COPY --from=builder /app/irc_bot /app/
|
COPY --from=builder /app/irc_bot /app/
|
||||||
|
|
||||||
CMD ["irc_bot"]
|
CMD ["./irc_bot"]
|
Loading…
Reference in New Issue