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

Handle nested files in copytocontainer script #295

Merged
merged 1 commit into from
Aug 27, 2020

Conversation

piotrkwiecinski
Copy link
Contributor

Tested with:

For files:

touch src/dev/tests/test-file2.txt
bin/copytocontainer dev/tests/test-file2.txt
bin/cli ls dev/tests/test-file2.txt

For directories:

mkdir -p src/dev/test-dir
touch src/dev/test-dir/test-file1.txt
touch src/dev/test-dir/test-file2.txt
bin/copytocontainer dev/test-dir
bin/cli ls -la dev/test-dir

Previous result for above was:

bin/copytocontainer dev/test-dir
Completed copying dev/test-dir from host to container
Correcting filesystem ownerships...
chown: cannot access '/var/www/html/dev/test-dir': No such file or directory
Filesystem ownerships corrected.
Correcting filesystem permissions...
find: 'dev/test-dir': No such file or directory
find: 'dev/test-dir': No such file or directory
Filesystem permissions corrected.

After the change:

bin/copytocontainer dev/test-dir
Completed copying dev/test-dir from host to container
Correcting filesystem ownerships...
Filesystem ownerships corrected.
Correcting filesystem permissions...
Filesystem permissions corrected.

Additional note: docker cp does not create parent directories for DEST_PATH if they do not exist. so there are still cases in which the above command may fail.

@markshust markshust merged commit 30b6303 into markshust:master Aug 27, 2020
@markshust
Copy link
Owner

Thanks again 🎉

@piotrkwiecinski piotrkwiecinski deleted the copytocontainer branch August 28, 2020 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants