Closed reconman closed 2 years ago
Could you please elaborate on why you think the desired behavior is not to print image labels?
For the medusa image specifically, I've had issues where the image contains infos about the commit used to build the image.
The app then shows that it's based on an old version and that an update is available, even though that's not true.
Additionally, the docker run
command without the image default values are closer to the original docker run
command used to produce the container. Isn't the goal of this project to do exactly that?
So that's why I'm proposing this solution of excluding default values from the produced docker run
command.
I would also be fine if this was turned into a feature which can be enabled or disabled via command line parameters.
Often Docker images have default labels and environment variables.
For example, if I run
runlike
against the pymedusa/medusa container, I get the following output:All PYTHON_ environment variables and all labels are inherited from the original Docker image and lead to a giant reconstructed
docker run
command. Instead, the labels and environment variables from the image should not be printed at all.This can be accomplished by cross-checking any container labels and env variables against the result of
docker image inspect
. If the container labels or env variables are part of the image definition with the exact same values, they don't need to be printed.