Commit 5a6740e7 by Patrick Steinhardt

azure: build Docker images as part of the pipeline

The Docker images used for our continuous integration builds currently
live in the libgit2/libgit2-docker repository. To make any changes in
them, one has to make a PR there, get it reviewed, re-build the images
and publish them to Docker Hub. This process is slow and tedious, making
it harder than necessary to perform any updates to our Docker-based
build pipeline.

To fix this, we include all Dockerfiles used by Azure from the mentioned
repository and inline them into our own repo. Instead of having to
manually push them to the CI, it will now build the required containers
on each pull request, allowing much greater flexibility.
parent 561a3a20
......@@ -13,7 +13,9 @@ jobs:
steps:
- template: azure-pipelines/docker.yml
parameters:
imageName: 'libgit2/trusty-amd64:latest'
docker:
image: trusty
base: ubuntu:trusty
environmentVariables: |
CC=gcc
CMAKE_GENERATOR=Unix Makefiles
......@@ -26,7 +28,9 @@ jobs:
steps:
- template: azure-pipelines/docker.yml
parameters:
imageName: 'libgit2/trusty-amd64:latest'
docker:
image: trusty
base: ubuntu:trusty
environmentVariables: |
CC=gcc
CMAKE_GENERATOR=Unix Makefiles
......@@ -39,7 +43,9 @@ jobs:
steps:
- template: azure-pipelines/docker.yml
parameters:
imageName: 'libgit2/trusty-amd64:latest'
docker:
image: trusty
base: ubuntu:trusty
environmentVariables: |
CC=clang
CMAKE_GENERATOR=Unix Makefiles
......@@ -52,7 +58,9 @@ jobs:
steps:
- template: azure-pipelines/docker.yml
parameters:
imageName: 'libgit2/trusty-amd64:latest'
docker:
image: trusty
base: ubuntu:trusty
environmentVariables: |
CC=clang
CMAKE_GENERATOR=Unix Makefiles
......@@ -137,6 +145,10 @@ jobs:
vmImage: 'Ubuntu 16.04'
steps:
- script: |
cd $(Build.SourcesDirectory)/azure-pipelines/docker
docker build -t libgit2/docurium --build-arg BASE=ubuntu:trusty -f docurium .
displayName: 'Build Docker image'
- script: |
git config user.name 'Documentation Generation'
git config user.email 'libgit2@users.noreply.github.com'
git branch gh-pages origin/gh-pages
......
......@@ -4,11 +4,15 @@ steps:
- script: docker run --rm --privileged multiarch/qemu-user-static:register --reset
displayName: 'Register Docker QEMU'
- script: |
cd $(Build.SourcesDirectory)/azure-pipelines/docker
docker build -t libgit2/${{parameters.docker.image}} --build-arg BASE=${{parameters.docker.base}} -f ${{parameters.docker.image}} .
displayName: 'Build Docker image'
- task: docker@0
displayName: Build
inputs:
action: 'Run an image'
imageName: ${{ parameters.imageName }}
imageName: libgit2/${{ parameters.docker.image }}
volumes: |
$(Build.SourcesDirectory):/src
$(Build.BinariesDirectory):/build
......@@ -20,7 +24,7 @@ steps:
displayName: Test
inputs:
action: 'Run an image'
imageName: ${{ parameters.imageName }}
imageName: libgit2/${{ parameters.docker.image }}
volumes: |
$(Build.SourcesDirectory):/src
$(Build.BinariesDirectory):/build
......
ARG BASE
FROM $BASE
ARG CACHEBUST=1
RUN apt-get update
RUN apt-get -y install pkgconf clang git cmake curl libssl-dev libcurl4 libcurl4-openssl-dev libssh2-1-dev libz-dev valgrind openssh-client openssh-server
RUN if [ "$ARCH" != "armhf" -a "$ARCH" != "arm64" ]; then apt-get -y install openjdk-11-jre-headless; fi
RUN mkdir /var/run/sshd
FROM debian:jessie-slim
ARG CACHEBUST=1
RUN apt-get update
RUN apt install -y cmake pkg-config ruby ruby-dev llvm libclang-3.5-dev libssl-dev python-pygments
ARG CACHEBUST=1
RUN gem install docurium
ARG BASE
FROM $BASE
ARG CACHEBUST=1
RUN apt-get update
RUN apt-get install -y curl apt-transport-https software-properties-common
RUN curl -sSL "https://bintray.com/user/downloadSubjectPublicKey?username=bintray" | apt-key add -
RUN echo "deb https://dl.bintray.com/libgit2/ci-dependencies trusty libgit2deps" >> /etc/apt/sources.list
RUN add-apt-repository ppa:openjdk-r/ppa -y
RUN apt-get update
RUN apt-get -y install clang git cmake libssl-dev libcurl3 libcurl3-gnutls libcurl4-gnutls-dev libssh2-1-dev valgrind openssh-client openssh-server openjdk-8-jre libpcre3 libpcre3-dev
RUN git clone --branch mbedtls-2.6.1 https://github.com/ARMmbed/mbedtls.git /tmp/mbedtls
RUN (cd /tmp/mbedtls && scripts/config.pl set MBEDTLS_MD4_C 1)
RUN (cd /tmp/mbedtls && CFLAGS=-fPIC cmake -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=OFF -DUSE_STATIC_MBEDTLS_LIBRARY=ON .)
RUN (cd /tmp/mbedtls && cmake --build .)
RUN (cd /tmp/mbedtls && make install)
RUN rm -rf /tmp/mbedtls
RUN mkdir /var/run/sshd
ARG BASE
FROM $BASE
ARG CACHEBUST=1
RUN apt-get update
RUN apt-get -y install pkgconf clang git cmake curl libssl-dev libcurl3 libcurl3-gnutls libcurl4-gnutls-dev valgrind openssh-client openssh-server openjdk-8-jre
RUN mkdir /var/run/sshd
......@@ -9,7 +9,9 @@ jobs:
steps:
- template: docker.yml
parameters:
imageName: 'libgit2/trusty-amd64:latest'
docker:
image: trusty
base: ubuntu:trusty
environmentVariables: |
CC=gcc
CMAKE_GENERATOR=Unix Makefiles
......@@ -23,7 +25,9 @@ jobs:
steps:
- template: docker.yml
parameters:
imageName: 'libgit2/trusty-amd64:latest'
docker:
image: trusty
base: ubuntu:trusty
environmentVariables: |
CC=gcc
CMAKE_GENERATOR=Unix Makefiles
......@@ -37,7 +41,9 @@ jobs:
steps:
- template: docker.yml
parameters:
imageName: 'libgit2/trusty-amd64:latest'
docker:
image: trusty
base: ubuntu:trusty
environmentVariables: |
CC=clang
CMAKE_GENERATOR=Unix Makefiles
......@@ -51,7 +57,9 @@ jobs:
steps:
- template: docker.yml
parameters:
imageName: 'libgit2/trusty-amd64:latest'
docker:
image: trusty
base: ubuntu:trusty
environmentVariables: |
CC=clang
CMAKE_GENERATOR=Unix Makefiles
......@@ -144,7 +152,9 @@ jobs:
- template: docker.yml
parameters:
qemu: 'true'
imageName: 'libgit2/bionic-x86:latest'
docker:
image: bionic
base: multiarch/ubuntu-core:x86-bionic
environmentVariables: |
CC=gcc
CMAKE_GENERATOR=Unix Makefiles
......@@ -159,7 +169,9 @@ jobs:
- template: docker.yml
parameters:
qemu: 'true'
imageName: 'libgit2/bionic-x86:latest'
docker:
image: bionic
base: multiarch/ubuntu-core:x86-bionic
environmentVariables: |
CC=clang
CMAKE_GENERATOR=Unix Makefiles
......@@ -174,7 +186,9 @@ jobs:
- template: docker.yml
parameters:
qemu: 'true'
imageName: 'libgit2/bionic-arm32:latest'
docker:
image: bionic
base: multiarch/ubuntu-core:armhf-bionic
environmentVariables: |
CC=gcc
CMAKE_GENERATOR=Unix Makefiles
......@@ -190,7 +204,9 @@ jobs:
- template: docker.yml
parameters:
qemu: 'true'
imageName: 'libgit2/bionic-arm64:latest'
docker:
image: bionic
base: multiarch/ubuntu-core:arm64-bionic
environmentVariables: |
CC=gcc
CMAKE_GENERATOR=Unix Makefiles
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment