I would like to create my own image of Nagios (I am getting started using some of the Dockerfile from jasonrivers\nagios image)
My Dockerfile apparently is not correctly formatted and I am not sure why
Here is the line that throws an error
RUN /bin/sh -c (egrep -i '^${NAGIOS_GROUP}' /etc/group || groupadd $NAGIOS_GROUP) && (egrep -i '^${NAGIOS_CMDGROUP}' /etc/group || groupadd $NAGIOS_CMDGROUP)
And the error:
=> ERROR [ 3/28] RUN /bin/sh -c (egrep -i '^${NAGIOS_GROUP}' /etc/group || groupadd nagios) && (egrep -i '^${NAGIOS_CMDGROUP}' /etc/group || groupadd nagios) 0.1s
------
> [ 3/28] RUN /bin/sh -c (egrep -i '^${NAGIOS_GROUP}' /etc/group || groupadd nagios) && (egrep -i '^${NAGIOS_CMDGROUP}' /etc/group || groupadd nagios):
0.079 /bin/sh: 1: Syntax error: "(" unexpected
------
Dockerfile:43
--------------------
41 |
42 | #NAGIOS GROUP & USER
43 | >>> RUN /bin/sh -c (egrep -i '^${NAGIOS_GROUP}' /etc/group || groupadd $NAGIOS_GROUP) && (egrep -i '^${NAGIOS_CMDGROUP}' /etc/group || groupadd $NAGIOS_CMDGROUP)
44 | RUN /bin/sh -c ( id -u $NAGIOS_USER || useradd --system -d $NAGIOS_HOME -g $NAGIOS_GROUP $NAGIOS_USER ) \
45 | && ( id -u $NAGIOS_CMDUSER || useradd --system -d $NAGIOS_HOME -g $NAGIOS_CMDGROUP $NAGIOS_CMDUSER )
--------------------
ERROR: failed to solve: process "/bin/sh -c /bin/sh -c (egrep -i '^${NAGIOS_GROUP}' /etc/group || groupadd $NAGIOS_GROUP) && (egrep -i '^${NAGIOS_CMDGROUP}' /etc/group || groupadd $NAGIOS_CMDGROUP)" did not complete successfully: exit code: 2