grycap / minicon

Minimization of the filesystem for containers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot minimize images that have environment variables with whitespaces

srisco opened this issue · comments

Hi, I'm using minicon and recently found a bug that could be related with this. I think updating the function read_files_in_array() in mergecon it can be solved, but not sure.

You can reproduce it by creating a dummy image adding an environment variable with a whitespace:

FROM bitnami/minideb

ENV TEST="foo bar"

and minimizing with minidock -i test-bug-minidock -- bash you get:

[WARNING]  2020.09.25-10:55:37 No image provided. A random one will be created (it will be echoed at the end of the procedure)
/etc/ld.so.cache
/etc/nsswitch.conf
/etc/passwd
/bin/bash
/lib/x86_64-linux-gnu/libc-2.24.so
/lib/x86_64-linux-gnu/libdl-2.24.so
/lib/x86_64-linux-gnu/libnsl-2.24.so
/lib/x86_64-linux-gnu/libnss_compat-2.24.so
/lib/x86_64-linux-gnu/libnss_files-2.24.so
/lib/x86_64-linux-gnu/libnss_nis-2.24.so
/lib/x86_64-linux-gnu/libtinfo.so.5.9
/lib/x86_64-linux-gnu/ld-2.24.so
ldconfig recreated
Error response from daemon: Syntax error - can't find = in "bar". Must be of the form: name=value
c107f403:latest

Cheers.