1.构建基础镜像,主要做安装和获取注册号:
FROM ubuntu:16.04
ADD Nessus-8.11.0-debian6_amd64.deb /tmp/Nessus-8.11.0-debian6_amd64.deb
RUN apt-get update -y
&& apt-get install -y apt-utils tzdata
&& dpkg -i /tmp/Nessus-8.11.0-debian6_amd64.deb
&& rm -rf /tmp/*
&& apt clean
&& echo "*********************************************"
&& /opt/nessus/sbin/nessuscli fetch --challenge
&& echo "*********************************************"
2.更新插件,根据步骤1中获取到的注册码在Web端进行注册,获取license,并将license添加至镜像中
FROM nessus:base
ADD license /tmp/license
ADD all-2.0.tar.gz /tmp/all-2.0.tar.gz
RUN echo "*******************update-plugin**************************"
&& /opt/nessus/sbin/nessuscli update /tmp/all-2.0.tar.gz
&& echo "*******************update-plugin**************************"
&& rm -rf /tmp/all-2.0.tar.gz
&& apt clean
&& echo "*******************register-offline**************************"
&& /opt/nessus/sbin/nessuscli fetch --register-offline /tmp/license
&& echo "*******************register-offline**************************"
EXPOSE 8834
CMD /etc/init.d/nessusd start && tail -f /dev/null