Class 17 Notes
Class 17 Notes
Dockerfile
==========
INSTRUCTIONS OS_CMD/OPTIONS
------------ --------------
FROM <BaseImageName>
RUN <OS-CMD/SCRIPT>
CMD <OS-CMD/SCRIPT> # This will get executed in the begining during
runtime
["executable","arg1","arg2"]
ENTRYPOINT ["executable","arg1","arg2"]
ENV <EnvVariable> <Value>
USER <userId>
WORKDIR <dir>
COPY <Host-Src> <Image-Dest>
ADD <Host-Src> <Image-Dest>
EXPOSE <Port>
Example:
FROM centos
RUN yum -y update
RUN yum install -y vim
RUN touch /tmp/DUMMY
CMD ["/bin/bash"]
ENV JAVA_HOME /opt/jdk1.8
ENV MYNAME ADAM
USER adam
WORKDIR /tmp
COPY startup.sh /tmp/startup.sh
ADD test.tar /tmp
EXPOSE 8080
ENTRYPOINT ["/bin/sh","startup.sh"]
/bin/sh startup.sh -xarg2
#!/bin/sh
while true
do
echo hello-students
sleep 8
done
*Ajitha Gomathi*
*WEZVA Coordinator* | Mob : +91-9739110917