Browse Source

Initial commit

master
Kenneth Bruen 4 years ago
commit
b9112c2e9e
Signed by: kbruen
GPG Key ID: C1980A470C3EE5B1
  1. 1
      .gitignore
  2. 21
      alpine/Dockerfile
  3. 16
      alpine/build.sh
  4. 22
      debian/Dockerfile
  5. 16
      debian/build.sh
  6. 22
      ubuntu/Dockerfile
  7. 16
      ubuntu/build.sh

1
.gitignore vendored

@ -0,0 +1 @@
workspace.code-workspace

21
alpine/Dockerfile

@ -0,0 +1,21 @@
ARG ALPINE_VERSION
FROM alpine:${ALPINE_VERSION} AS builder
WORKDIR /tdlib
RUN apk update && apk upgrade && apk add --update alpine-sdk linux-headers git zlib-dev openssl-dev gperf php cmake
RUN git clone https://github.com/tdlib/td.git .
ARG TDLIB_VER
RUN git checkout "tags/v${TDLIB_VER}"
RUN rm -rf build && mkdir build
WORKDIR /tdlib/build
RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib ..
RUN cmake --build . --target prepare_cross_compiling
WORKDIR /tdlib
RUN php SplitSource.php
WORKDIR /tdlib/build
RUN cmake --build . --target install
WORKDIR /tdlib
RUN php SplitSource.php --undo
FROM alpine:${ALPINE_VERSION}
WORKDIR /tdlib
COPY --from=builder /tdlib/tdlib /tdlib

16
alpine/build.sh

@ -0,0 +1,16 @@
#! /usr/bin/env sh
if [ -z $ALPINE_VERSION ]
then
echo "Please specify a version by setting the ALPINE_VERSION env var"
exit 1
fi
if [ $# -eq 1 ]
then
export TDLIB_VER="$1"
else
export TDLIB_VER="1.7.0"
fi
docker build -t "tdlib:$TDLIB_VER-alpine-$ALPINE_VERSION" --build-arg TDLIB_VER --build-arg ALPINE_VERSION .

22
debian/Dockerfile vendored

@ -0,0 +1,22 @@
ARG DEBIAN_VERSION
FROM debian:${DEBIAN_VERSION} AS builder
WORKDIR /tdlib
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install make git zlib1g-dev libssl-dev gperf php-cli cmake clang libc++-dev libc++abi-dev
RUN git clone https://github.com/tdlib/td.git .
ARG TDLIB_VER
RUN git checkout "tags/v${TDLIB_VER}"
RUN rm -rf build && mkdir build
WORKDIR /tdlib/build
RUN CXXFLAGS="-stdlib=libc++" CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib ..
RUN cmake --build . --target prepare_cross_compiling
WORKDIR /tdlib
RUN php SplitSource.php
WORKDIR /tdlib/build
RUN cmake --build . --target install
WORKDIR /tdlib
RUN php SplitSource.php --undo
FROM debian:${DEBIAN_VERSION}
WORKDIR /tdlib
COPY --from=builder /tdlib/tdlib /tdlib

16
debian/build.sh vendored

@ -0,0 +1,16 @@
#! /usr/bin/env sh
if [ -z $DEBIAN_VERSION ]
then
echo "Please specify a version by setting the DEBIAN_VERSION env var"
exit 1
fi
if [ $# -eq 1 ]
then
export TDLIB_VER="$1"
else
export TDLIB_VER="1.7.0"
fi
docker build -t "tdlib:$TDLIB_VER-$DEBIAN_VERSION" --build-arg TDLIB_VER --build-arg DEBIAN_VERSION .

22
ubuntu/Dockerfile

@ -0,0 +1,22 @@
ARG UBUNTU_VERSION
FROM ubuntu:${UBUNTU_VERSION} AS builder
WORKDIR /tdlib
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install make git zlib1g-dev libssl-dev gperf php-cli cmake clang-10 libc++-dev libc++abi-dev
RUN git clone https://github.com/tdlib/td.git .
ARG TDLIB_VER
RUN git checkout "tags/v${TDLIB_VER}"
RUN rm -rf build && mkdir build
WORKDIR /tdlib/build
RUN CXXFLAGS="-stdlib=libc++" CC=/usr/bin/clang-10 CXX=/usr/bin/clang++-10 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib -DTD_ENABLE_LTO=ON -DCMAKE_AR=/usr/bin/llvm-ar-10 -DCMAKE_NM=/usr/bin/llvm-nm-10 -DCMAKE_OBJDUMP=/usr/bin/llvm-objdump-10 -DCMAKE_RANLIB=/usr/bin/llvm-ranlib-10 ..
RUN cmake --build . --target prepare_cross_compiling
WORKDIR /tdlib
RUN php SplitSource.php
WORKDIR /tdlib/build
RUN cmake --build . --target install
WORKDIR /tdlib
RUN php SplitSource.php --undo
FROM ubuntu:${UBUNTU_VERSION}
WORKDIR /tdlib
COPY --from=builder /tdlib/tdlib /tdlib

16
ubuntu/build.sh

@ -0,0 +1,16 @@
#! /usr/bin/env sh
if [ -z $UBUNTU_VERSION ]
then
echo "Please specify a version by setting the UBUNTU_VERSION env var"
exit 1
fi
if [ $# -eq 1 ]
then
export TDLIB_VER="$1"
else
export TDLIB_VER="1.7.0"
fi
docker build -t "tdlib:$TDLIB_VER-$UBUNTU_VERSION" --build-arg TDLIB_VER --build-arg UBUNTU_VERSION .
Loading…
Cancel
Save