Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in /utils/dirs.go#CopyFile() #37

Closed
vintage-chou opened this issue Jul 31, 2017 · 3 comments
Closed

Problem in /utils/dirs.go#CopyFile() #37

vintage-chou opened this issue Jul 31, 2017 · 3 comments
Labels

Comments

@vintage-chou
Copy link

Hi!

I found when copying files, it could not copy the symbol links correctly. It will always follow the symbol link, so some dependency issues will occur.

I think it should be

func CopyFile(src, dst string, makeDir bool) error {
	info, err := os.Lstat(src)
        ...
}

instead of

func CopyFile(src, dst string, makeDir bool) error {
	info, err := os.Stat(src)
        ...
}
@kcq
Copy link
Member

kcq commented Jul 31, 2017

Thank you for the report! What do you mean by "when copying files"? Are you using the utils package directly? The DockerSlim code uses it only when it needs to copy additional files based on the include-paths command line parameter. The main files DockerSlim discovers are copied using another method...

You are right about the Lstat() call though. There's a couple of other places with the same problem, but it's not relevant there because the files are already pre-filtered into regular and link files.

@kcq kcq added the bug label Jul 31, 2017
@vintage-chou
Copy link
Author

Thank you for your reply! Indeed, I use the utils package directly. And as you said, the CopyFile() has no effect on the main files DockerSlim discovers.

I really appreciate docker-slim, thanks again.

@kcq
Copy link
Member

kcq commented Aug 1, 2017

It'll be fixed in a few days either way. Thank you for catching the bug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants