public String generateDockerfileFor ( Map < String , File > plugins ) throws IOException { StringBuilder builder = new StringBuilder ( ) ; builder . append ( "FROM scratch" ) . append ( NL ) . append ( "MAINTAINER Kanstantsin Shautsou <kanstantsin.sha@gmail.com>" ) . append ( NL ) . append ( "COPY ./ /" ) . append ( NL ) . append ( "VOLUME /usr/share/jenkins/ref" ) . append ( NL ) ; for ( Map . Entry < String , String > entry : generateLabels ( plugins ) . entrySet ( ) ) { builder . append ( "LABEL " ) . append ( entry . getKey ( ) ) . append ( "=" ) . append ( entry . getValue ( ) ) . append ( NL ) ; } // newClientBuilderForConnector.append("LABEL GENERATION_UUID=").append(UUID.randomUUID()).append(NL); return builder . toString ( ) ; }
Dockerfile as String based on sratch for placing plugins .