Provided a key or field, is it possible to perform some string manipulation before its output using the Go text/template engine. This is to improve the template in this gist, which aims at recreating the docker run
command that led to a container through running docker inspect
. The leading --name={{.Name}} \
does not fully work as it outputs a leading slash, a slash character that needs to be removed to recreate a container with the same name.
As this can only be based on the templating facility that is built in docker, I cannot use external functions or similar.