I have the below Dockerfile which I want to build. It's basically just the normal jboss/wildfly base image, but built with amazonlinux instead of centOS.
The build error's out with the line "groupadd: Command not found"
After this happened the first time I added the "epel" repo and tried installing it manually as you can see in the first RUN instruction. I have read a few forums and seems like sometimes you get that error message when you're not running as root. I did a "whoami" and I am running as root, so it shouldn't be an issue.
Anyone got any idea why I'm still getting an error?
FROM amazonlinux:2017.03
# Install packages necessary to run EAP
RUN yum-config-manager --enable epel && yum update -y && yum -y install groupadd xmlstarlet saxon augeas bsdtar unzip && yum clean all
# Create a user and group used to launch processes
# The user ID 1000 is the default for the first "regular" user on Fedora/RHEL,
# so there is a high chance that this ID will be equal to the current user
# making it easier to use volumes (no permission issues)
RUN groupadd -r jboss -g 1000 && useradd -u 1000 -r -g jboss -m -d /opt/jboss -s /sbin/nologin -c "JBoss user" jboss && \
chmod 755 /opt/jboss
# Set the working directory to jboss' user home directory
WORKDIR /opt/jboss
# Specify the user which should be used to execute all commands below
USER jboss
Thanks in advance!