I am trying to create my custom Jboss image, for which I am facing an issue.
Below is my docker file, am trying to copy specific JDK and Joss to /opt/jboss and unzip/untar the files to install Jboss and changing the /opt/jboss ownership to jboss.
Initially I have tried with ubuntu base image, but the image built was failed with below error.
I am unable to install unzip command to ubuntu image, so in base context I extracted the files and copy to image, now I can create base jboss image, now i want to explore more this by doing customizations.
FROM ubuntu
RUN mkdir /opt/jboss
COPY jboss-eap-7.0 /opt/jboss/jboss-eap-7.0
COPY jdk1.8.0_77 /opt/jboss/jdk1.8.0_77
RUN groupadd jboss \
&& useradd -d /home/jboss -g jboss jboss \
&& chown -R jboss.jboss /opt/jboss \
I just ran a container, but it is strange to see that the home directory for the user jboss is not created, any idea how to achieve this. I explicitly mentioned the home directory in docker file
RUN groupadd jboss
&& useradd -d /home/jboss -g jboss jboss
root@f12fb5ec8232:~# su - jboss
su: warning: cannot change directory to /home/jboss: No such file or directory
I have manually created the home directory of jboss user and .profile file, and i can apply patch to exist image by using below docker file
FROM 91ec906328fe
COPY jboss-eap-7.0.9-patch.zip /opt/jboss
RUN su - jboss -c '/opt/jboss/jboss-eap-7.0/bin/standalone.sh &'
RUN su - jboss -c '/opt/jboss/jboss-eap-7.0/bin/jboss-cli.sh "patch apply /opt/jboss/jboss-eap-7.0.9-patch.zip"'
Step 1/5 : FROM 91ec906328fe
---> 91ec906328fe
Step 2/5 : COPY jboss-eap-7.0.9-patch.zip /opt/jboss
---> f9ed853b89a8
Step 3/5 : RUN su - jboss -c '/opt/jboss/jboss-eap-7.0/bin/standalone.sh &'
---> Running in b5e110dc33d4
Removing intermediate container b5e110dc33d4
---> c2b861b0cae5
Step 4/5 : RUN su - jboss -c '/opt/jboss/jboss-eap-7.0/bin/jboss-cli.sh "patch apply /opt/jboss/jboss-eap-7.0.9-patch.zip"'
---> Running in f457d82eb096
{
"outcome" : "success",
"result" : {}
}
Removing intermediate container f457d82eb096
---> 31992c81736d
Removing intermediate container 31992c81736d
---> b9afb2c4e8bf
Successfully built b9afb2c4e8bf
when i run the container from the image jboss patch was applied successfully.
FROM ubuntu
RUN apt-get update -y \
&& apt-get install -y unzip \
&& ...
Aside, using Markdown “fenced code blocks” like the following helps a lot to keep things readable (like to keep indentation, not yield curly quotes, and to not hide \ characters):