From: Jonatan Schlag Date: Sat, 7 Oct 2017 09:04:06 +0000 (+0200) Subject: Add a Dockerfile X-Git-Url: http://git.ipfire.org/?p=people%2Fjschlag%2Fpbs.git;a=commitdiff_plain;h=576ff9009a43c79a8b6f3de7f8c255ddbfabccf3 Add a Dockerfile To create a container for our pbs service we add a Docker image based on ipfire/pakfire:latest. Signed-off-by: Jonatan Schlag Signed-off-by: Michael Tremer --- diff --git a/.gitignore b/.gitignore index c6d6982..1e65027 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/Dockerfile /Makefile /build-aux /pbs.conf diff --git a/Dockerfile.in b/Dockerfile.in new file mode 100644 index 0000000..43ed99b --- /dev/null +++ b/Dockerfile.in @@ -0,0 +1,46 @@ +FROM ipfire/pakfire: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@" + +# Install all dependencies +RUN yum install -y \ + autoconf \ + intltool \ + make \ + python-daemon \ + python-memcached \ + python-psycopg2 \ + python-tornado \ + pytz-2016.10 \ + && yum clean all + +# Create a user +RUN groupadd -g 2000 pbs && \ + useradd --system --no-create-home --shell /bin/bash --uid 2000 --gid 2000 pbs + +# Copy the source code +COPY . /build/pakfire-build-service + +WORKDIR /build/pakfire-build-service + +# Compile the build service +RUN ./autogen.sh && \ + ./configure --prefix=/usr --sysconfdir=/etc \ + make && make check && make install && rm -rf /build/pakfire-build-service + +# Go back to /root +WORKDIR /root + +# Cleanup +RUN yum remove -y *-devel && yum autoremove -y && yum clean all + +USER pbs + +# Define default command. +CMD ["/bin/bash"] + diff --git a/Makefile.am b/Makefile.am index 514e3ab..026a74b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -396,6 +396,20 @@ static_jsdir = $(staticdir)/js # ------------------------------------------------------------------------------ +EXTRA_DIST += \ + Dockerfile.in + +docker_DATA = \ + Dockerfile + +dockerdir = $(datadir)/docker + +.PHONY: docker +docker: Dockerfile + docker build -t "ipfire/pakfire-build-service:$(PACKAGE_VERSION)" . + +# ------------------------------------------------------------------------------ + if HAVE_SYSTEMD systemdsystemunit_DATA = \ # TODO