uber-archive / makisu

Fast and flexible Docker image building tool, works in unprivileged containerized environments like Mesos and Kubernetes.
Apache License 2.0
2.41k stars 156 forks source link

Quotes not escaped in COPY directive destination #276

Closed dylanplecki closed 4 years ago

dylanplecki commented 4 years ago

Describe the bug Quotes present in the COPY directive's destination argument are not escaped and become part of the resulting path in the container image.

This may also be present in other directives or the source argument for the COPY directive (untested).

To Reproduce Steps to reproduce the behavior:

$ mkdir makisu-copy-test && cd makisu-copy-test
$ echo "my file" >foo.txt
$ echo >Dockerfile <<EOF
FROM debian:latest
COPY foo.txt "/usr/local/share/foo.txt"
EOF
$ makisu -t makisu-copy-test .
$ docker run -it makisu-copy-test ash
/ # ls
"      bin    dev    etc    home   lib    media  mnt    opt    proc   root   run    sbin   srv    sys    tmp    usr    var
/ # cat /\"/usr/local/share/foo.txt\"
my file

Expected behavior

test -f /usr/local/share/foo.txt && echo "Assertion Succeeded" || echo "Assertion Failed"

Environments Any OS environment. Tested and present on Makisu v0.1.11.

Additional context The issue may apply to other directives.