docker-maven-plugin icon indicating copy to clipboard operation
docker-maven-plugin copied to clipboard

Special characters in filenames are not escaped

Open nudgegoonies opened this issue 8 years ago • 3 comments

Description

I have a Spring Project which produces files with a $ character in the middle of one filename. The $ sign is not escaped in the dockerfile and docker build tries variable substitution and cannot find the file.

How to reproduce

I have this file:

ServletInitializer$ApplicationContextHolder.class

What do you expect

$ character is escaped and file is copied to the image.

What happened instead

The $ character is not escaped in the dockerfile produced by the docker-maven-plugin. Docker cannot find the file because characters after the $ are interpreted as variable. In my case, the variable $ApplicationContextHolder does not exists and docker only looks for ServletInitializer.class

Software:

  • docker version: 1.11.2
  • docker-maven-plugin version: 0.4.10
  • maven version: 3.3.9

Link to documentation where escaping is explained:

https://docs.docker.com/engine/reference/builder/

nudgegoonies avatar Jul 07 '16 07:07 nudgegoonies

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 11 '18 13:09 stale[bot]

Any update on this ?

Abhishek1121-tech avatar Nov 06 '20 11:11 Abhishek1121-tech

At least for us this was fixed here: https://github.com/spotify/docker-maven-plugin/pull/248

nudgegoonies avatar Nov 06 '20 11:11 nudgegoonies