40 lines
764 B
Docker
40 lines
764 B
Docker
FROM golang:alpine as builder
|
|
|
|
RUN apk add --no-cache \
|
|
gperf \
|
|
alpine-sdk \
|
|
openssl-dev \
|
|
git \
|
|
cmake \
|
|
zlib-dev \
|
|
linux-headers
|
|
|
|
WORKDIR /tmp/_build_tdlib/
|
|
|
|
RUN git clone --depth 1 --branch v1.6.0 https://github.com/tdlib/td.git /tmp/_build_tdlib/
|
|
|
|
RUN mkdir build
|
|
WORKDIR /tmp/_build_tdlib/build/
|
|
|
|
RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ..
|
|
RUN cmake --build . -- -j9
|
|
RUN make install
|
|
|
|
ARG COMMIT=latest
|
|
|
|
WORKDIR /app/
|
|
|
|
RUN GOBIN=/app/ go install git.siteop.biz/chtwrs/gocw@$COMMIT
|
|
|
|
FROM alpine:latest
|
|
|
|
RUN apk add --no-cache \
|
|
libstdc++
|
|
|
|
WORKDIR /app/
|
|
|
|
# Copy the Pre-built binary file from the previous stage
|
|
COPY --from=builder /app/gocw .
|
|
# Command to run the executable
|
|
CMD ["./gocw"]
|