Skip to content

Commit 0aa5e83

Browse files
Merge pull request #33 from fledge-iot/FOGL-5142.2
FOGL-5142: Dockerfile for CentOS 7
2 parents 2236faa + 4b8a96f commit 0aa5e83

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

docker/latest/Dockerfile.centos7

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM centos:7
2+
3+
LABEL maintainer="[email protected]"
4+
5+
ENV ARCHITECTURE="x86_64"
6+
ENV OS="centos7"
7+
8+
ARG PKG_VERSION="latest"
9+
10+
ENV FLEDGE_PKGS_ARCHIVES_LINK="http://archives.fledge-iot.org/${PKG_VERSION}/${OS}/${ARCHITECTURE}/"
11+
12+
# Install pre-requisites
13+
RUN yum update -y && \
14+
yum install -y rsyslog curl wget jq centos-release-scl-rh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
15+
yum install -y nginx
16+
17+
18+
# Fake service control as docker container doesn't use it
19+
RUN printf '#!/bin/bash \nexit 0' > /usr/bin/systemctl
20+
RUN chmod 755 /usr/bin/systemctl
21+
22+
# Install Fledge repo within container
23+
RUN echo -e "[fledge]\n\
24+
name=fledge Repository\n\
25+
baseurl=${FLEDGE_PKGS_ARCHIVES_LINK}\n\
26+
enabled=1\n\
27+
gpgkey=http://archives.fledge-iot.org/RPM-GPG-KEY-fledge\n\
28+
gpgcheck=1" > /etc/yum.repos.d/fledge.repo
29+
30+
# Install fledge
31+
RUN yum update -y && yum install -y fledge
32+
33+
# Fix and install fledge-gui
34+
# With fledge-gui PR https://github.com/fledge-iot/fledge-gui/pull/105,
35+
# below fix will not be required, next to the 1.9.1 releases.
36+
RUN rm -f /usr/share/nginx/html/index.html && \
37+
yum install -y fledge-gui
38+
39+
# Build the Start Script
40+
RUN echo "service rsyslog start" > start.sh && \
41+
echo "nginx" >> start.sh && \
42+
echo "/usr/local/fledge/bin/fledge start" >> start.sh && \
43+
echo "tail -f /var/log/messages" >> start.sh && \
44+
chmod +x start.sh
45+
46+
47+
ENV FLEDGE_ROOT=/usr/local/fledge
48+
49+
# VOLUME /usr/local/fledge/data
50+
51+
# Fledge API and Fledge GUI ports
52+
EXPOSE 8081 1995 80
53+
54+
CMD ["bash", "./start.sh"]

0 commit comments

Comments
 (0)