Browse Source

Initial commit

master
Vladimir Hodakov 9 months ago
commit
faf69cda63
Signed by: Vladimir Hodakov <vladimir@hodakov.me> GPG Key ID: 673980B6882F82C6
4 changed files with 45 additions and 0 deletions
  1. +25
    -0
      .gitlab-ci.yml
  2. +10
    -0
      Dockerfile
  3. +3
    -0
      README.md
  4. +7
    -0
      ci/set_docker_tag.sh

+ 25
- 0
.gitlab-ci.yml View File

@@ -0,0 +1,25 @@
image: docker:stable

variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
CONTAINER_NAME: lab.wtfteam.pro:4567/containers/tdlib-go

services:
- docker:dind

stages:
- build

before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY

build:
stage: build
script:
- source ci/set_docker_tag.sh
- docker build -t $CONTAINER_NAME:$DOCKER_TAG .
- docker push $CONTAINER_NAME:$DOCKER_TAG
only:
- tags
- master

+ 10
- 0
Dockerfile View File

@@ -0,0 +1,10 @@
ARG GOLANG_VERSION=1.12-alpine

FROM golang:$GOLANG_VERSION AS build

LABEL maintainer="vladimir@hodakov.me"

COPY --from=lab.wtfteam.pro:4567/containers/tdlib /usr/local/include/td /usr/local/include/td
COPY --from=lab.wtfteam.pro:4567/containers/tdlib /usr/local/lib/libtd* /usr/local/lib/

RUN apk update && apk add --no-cache git gcc libc-dev g++ make openssl-dev && rm -rf /var/cache/apk/*

+ 3
- 0
README.md View File

@@ -0,0 +1,3 @@
# Docker container with Go and pre-built tdlib

This image is tagged by tdlib version. Each container have latest Go version at the time of build.

+ 7
- 0
ci/set_docker_tag.sh View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash

if [[ $CI_BUILD_REF_NAME == "master" ]]; then
export DOCKER_TAG=latest;
else
export DOCKER_TAG="${CI_BUILD_REF_NAME}";
fi

Loading…
Cancel
Save