From 4d72fb7333f6c7a659139cb9d2099b817040f798 Mon Sep 17 00:00:00 2001 From: Jonatan Schlag Date: Sat, 23 Sep 2017 19:14:28 +0100 Subject: [PATCH] Add Dockerfile This file allows to create a docker image based on CentOS with pakfire pre-installed. Signed-off-by: Michael Tremer Signed-off-by: Jonatan Schlag --- .gitignore | 1 + Dockerfile.in | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ Makefile.am | 14 ++++++++++---- 3 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 Dockerfile.in diff --git a/.gitignore b/.gitignore index 293e999e..198e94ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/Dockerfile /Makefile /build-aux /libtool diff --git a/Dockerfile.in b/Dockerfile.in new file mode 100644 index 00000000..ea3e4feb --- /dev/null +++ b/Dockerfile.in @@ -0,0 +1,49 @@ +FROM centos:latest +MAINTAINER jonatanschlag + +LABEL \ + org.ipfire.pakfire.name = "@PACKAGE_NAME@" \ + org.ipfire.pakfire.url = "https://pakfire.ipfire.org" \ + org.ipfire.pakfire.vendor = "IPFire Project" \ + org.ipfire.pakfire.version = "@PACKAGE_VERSION@" + +# Update all OS packages +RUN yum update -y + +# Add EPEL +RUN yum install -y epel-release + +# Install all dependencies +RUN yum install -y \ + autoconf \ + file \ + gcc \ + git \ + intltool \ + libcap \ + libcap-devel \ + libtool \ + libsolv \ + libsolv-devel \ + make \ + python-devel \ + xz-devel + +# Copy the pakfire source code +ADD . /build/pakfire + +WORKDIR /build/pakfire + +# Compile pakfire +RUN ./autogen.sh && ./configure --prefix=/usr --sysconfdir=/etc && make -j4 && make check && make install + +# Go back to /root +WORKDIR /root + +# Cleanup +RUN rm -rf /build/pakfire && yum remove -y *-devel && yum autoremove -y && yum clean all + +USER root + +# Define default command. +CMD ["/bin/bash"] diff --git a/Makefile.am b/Makefile.am index bf7e42fb..c2fc6d99 100644 --- a/Makefile.am +++ b/Makefile.am @@ -35,6 +35,7 @@ pythondir = $(pyexecdir) configsdir = $(sysconfdir)/pakfire configsdistrosdir = $(configsdir)/distros +dockerdir = $(datadir)/docker macrosdir = $(prefix)/lib/pakfire/macros qualityagentdir = $(prefix)/lib/quality-agent scriptsdir = $(prefix)/lib/$(PACKAGE_NAME) @@ -329,6 +330,14 @@ endif # ------------------------------------------------------------------------------ +EXTRA_DIST += \ + Dockerfile.in + +docker_DATA = \ + Dockerfile + +# ------------------------------------------------------------------------------ + dist_configs_DATA = \ contrib/config/builder.conf \ contrib/config/client.conf \ @@ -352,10 +361,7 @@ SED_PROCESS = \ $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \ < $< > $@ -src/scripts/%: src/scripts/%.in Makefile - $(SED_PROCESS) - -src/systemd/%: src/systemd/%.in Makefile +%: %.in Makefile $(SED_PROCESS) # - testsuite ------------------------------------------------------------------ -- 2.39.2