diff options
Diffstat (limited to 'pkg/docker')
-rw-r--r-- | pkg/docker/.gitignore | 3 | ||||
-rw-r--r-- | pkg/docker/Dockerfile | 32 | ||||
-rw-r--r-- | pkg/docker/Makefile | 23 | ||||
-rw-r--r-- | pkg/docker/output/ReadMe | 1 | ||||
-rwxr-xr-x | pkg/docker/scripts/libyaml-dist.sh | 23 |
5 files changed, 82 insertions, 0 deletions
diff --git a/pkg/docker/.gitignore b/pkg/docker/.gitignore new file mode 100644 index 0000000..f5b0d6d --- /dev/null +++ b/pkg/docker/.gitignore @@ -0,0 +1,3 @@ +output/* +!Makefile +!output/ReadMe diff --git a/pkg/docker/Dockerfile b/pkg/docker/Dockerfile new file mode 100644 index 0000000..71f9df1 --- /dev/null +++ b/pkg/docker/Dockerfile @@ -0,0 +1,32 @@ +FROM ubuntu:18.04 + +RUN apt-get update \ + && apt-get install -y \ + automake \ + bison \ + build-essential \ + cmake \ + curl \ + doxygen \ + flex \ + git \ + less \ + libtool \ + python \ + vim \ + zip \ + && true + +# http://www.doxygen.nl/manual/install.html + +RUN curl https://sourceforge.net/projects/doxygen/files/rel-1.8.14/doxygen-1.8.14.src.tar.gz/download \ + -L -o /doxygen-1.8.14.src.tar.gz \ + && cd / \ + && tar -xvf doxygen-1.8.14.src.tar.gz \ + && cd doxygen-1.8.14 \ + && mkdir build \ + && cd build \ + && cmake -G "Unix Makefiles" .. \ + && make \ + && make install \ + && true diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile new file mode 100644 index 0000000..8a53ed3 --- /dev/null +++ b/pkg/docker/Makefile @@ -0,0 +1,23 @@ +DOCKER_IMAGE ?= yamlio/libyaml-dev + +build: + docker build -t $(DOCKER_IMAGE) . + +run: build + docker run -it --rm $(DOCKER_IMAGE) bash + +prepare-git: + rm -rf output/libyaml.git + git clone ../../.git output/libyaml.git + +libyaml-dist: libyaml-dist-ci + +libyaml-dist-ci: prepare-git + docker run --rm -u $$(id -u) \ + -v"$$PWD/output:/output" \ + -v"$$PWD/scripts:/scripts" \ + $(DOCKER_IMAGE) /scripts/libyaml-dist.sh + +clean: + rm -rf output/libyaml.git + rm -rf output/yaml-*.* diff --git a/pkg/docker/output/ReadMe b/pkg/docker/output/ReadMe new file mode 100644 index 0000000..acdc333 --- /dev/null +++ b/pkg/docker/output/ReadMe @@ -0,0 +1 @@ +Output directory for build files created by docker diff --git a/pkg/docker/scripts/libyaml-dist.sh b/pkg/docker/scripts/libyaml-dist.sh new file mode 100755 index 0000000..94e7696 --- /dev/null +++ b/pkg/docker/scripts/libyaml-dist.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -ex + +cp -r /output/libyaml.git /tmp/ +cd /tmp/libyaml.git +./bootstrap +./configure +make dist + +# get the tarball filename +tarballs=(yaml-*.tar.gz) +tarball=${tarballs[0]:?} +dirname=${tarball/.tar.gz/} + +# Copy to output dir +cp "$tarball" /output + +# Create zip archive +cd /tmp +cp "/output/$tarball" . +tar xvf "$tarball" +zip -r "/output/$dirname.zip" "$dirname" |