Last Updated: February 25, 2016
·
444
· kracetheking

Autogenerate Dockerfile from ubuntu image

sudo docker run ubuntu dpkg --get-selections | awk '{print $1}' >  base.list && sudo docker run  pyextra dpkg --get-selections | awk '{print $1}'> pyextra.list && sort base.list pyextra.list | uniq -u > op.list && python -c "f = open('Dockerfile', 'w');f.write('from ubuntu\n');f.write('RUN apt-get update\n');for line in open('op.list').readlines():f.write('run apt-get install -y {0}'.format(line));"