]> git.ipfire.org Git - people/jschlag/pbs.git/commitdiff
Add a Dockerfile
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Sat, 7 Oct 2017 09:04:06 +0000 (11:04 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 7 Oct 2017 10:50:53 +0000 (11:50 +0100)
To create a container for our pbs service we add a Docker
image based on ipfire/pakfire:latest.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
.gitignore
Dockerfile.in [new file with mode: 0644]
Makefile.am

index c6d69826fa396996343affa850ec09eb27a36a8e..1e65027470c6c61fb2c4a5dd23d055212dedd480 100644 (file)
@@ -1,3 +1,4 @@
+/Dockerfile
 /Makefile
 /build-aux
 /pbs.conf
diff --git a/Dockerfile.in b/Dockerfile.in
new file mode 100644 (file)
index 0000000..43ed99b
--- /dev/null
@@ -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"]
+
index 514e3ab4903e5e243129561443dc087c1b679bbe..026a74be8a96aab0ef4155f53e83f320fe59bcb5 100644 (file)
@@ -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