forked from xenserver/planex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (33 loc) · 1.15 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM centos:7.4.1708
MAINTAINER Euan Harris <[email protected]>
# yum-plugin-ovl works around problems on OverlayFS-backed containers:
# https://github.com/docker/docker/issues/10180
RUN yum -y install yum-plugin-ovl \
&& yum clean all
# Install basic prerequisites for building planex
RUN yum -y install \
epel-release \
yum-utils \
&& yum clean all
# Install sudo and preconfigure the sudoers file for the build user
RUN yum -y install sudo \
&& yum clean all \
&& echo 'build ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers \
&& sed -i.bak 's/^Defaults.*requiretty//g' /etc/sudoers
# Copy spec file and install dependencies.
# The spec file rarely changes, so the dependency installation layers
# can be cached even if the planex code needs to be rebuilt.
WORKDIR /usr/src
COPY planex.spec planex/
RUN yum-builddep -y planex/planex.spec \
&& awk '/^Requires:/ { print $2 }' planex/planex.spec | xargs yum -y install \
&& yum clean all \
&& mkdir /build
# Copy source, build and install it.
COPY . planex/
WORKDIR /usr/src/planex
RUN python setup.py build \
&& python setup.py install
WORKDIR /build
COPY docker/entry /entry
ENTRYPOINT ["/entry"]