tCleanup unneeded list remove calls. - docker2sh - Convert Dockerfiles into shell scripts HTML git clone https://git.parazyd.org/docker2sh DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit b6c34152a75eb70dd14229ead0d01967ce2bb024 DIR parent 41faa73154498002471b9f2f8bebac3da1a26faa HTML Author: parazyd <parazyd@dyne.org> Date: Wed, 20 Nov 2019 16:39:39 +0100 Cleanup unneeded list remove calls. Diffstat: M docker2sh.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) --- DIR diff --git a/docker2sh.py b/docker2sh.py t@@ -67,24 +67,20 @@ def parse_instruction(inst, dfile=None): 'STOPSIGNAL', 'USER', 'VOLUME', 'WORKDIR'] if ins == 'ADD': - cmds.remove(ins) val = val.replace('$', '\\$') args = val.split(' ') return 'wget -O %s %s\n' % (args[1], args[0]) if ins == 'ARG': - cmds.remove(ins) return '%s\n' % val if ins == 'ENV': - cmds.remove(ins) if '=' not in val: val = val.replace(' ', '=', 1) val = val.replace('$', '\\$') return 'export %s\n' % val if ins == 'RUN': - cmds.remove(ins) # Replace `` with $() while '`' in val: val = val.replace('`', '"$(', 1) t@@ -92,11 +88,9 @@ def parse_instruction(inst, dfile=None): return '%s\n' % val.replace('$', '\\$') if ins == 'WORKDIR': - cmds.remove(ins) return 'mkdir -p %s && cd %s\n' % (val, val) if ins == 'COPY': - cmds.remove(ins) if '/' in dfile: return compress_and_b64(val, basepath=dirname(dfile)) return compress_and_b64(val) t@@ -106,6 +100,7 @@ def parse_instruction(inst, dfile=None): return '#\n# %s not implemented\n# Instruction: %s %s\n#\n' % \ (ins, ins, val) + # Silently ignore unknown instructions return ''