Common commands of dockerfile

Time:2021-2-22

Common commands

FROM

LABEL

  • Description information
  • Example: label verision = “1.0” author = “TBC”

MAINTAINER

Common examples

# Version 0.0.1
FROM centos:7

#Author
MAINTAINER tianbocheng <[email protected]>

#Label version = "1.0" description = "secondary - IDIS - registration service"

#Environmental variables
ENV NODE=5.7

#Set time zone
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

#Add deployment file
ADD idis/ /home/

#Set working directory
WORKDIR /home

#Initialization
RUN echo "net.ipv4.tcp_tw_reuse=1" >> /etc/sysctl.conf

#Install RPM package
RUN rpm -ivh *.rpm

#Get execution permission
RUN chmod +x /home/DigestTool && chmod +x /home/start.sh && chmod +x /usr/local/idisapi/bin/runApi.sh

#Remove installation package
RUN rm -rf /home/*.rpm

#Image startup execution script
ENTRYPOINT ["/home/start.sh"]