Fix docker_clone_volume.sh to preserve hard-links #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using docker_clone_volume.sh, I found that when copying a volume with influxdb data, the clones image was bigger than the original.
cause: alpine base image contains a cp version (busybox) which does not preserve hardlinks, even with the -a option.
This is fixed by using an ubuntu base image instead of alpine.
downside: ubuntu image is larger to download than alpine. (~ 80MB vs 7 MB)
Source volume:
influxdb_data 380.2 MB
Before (busybox cp):
influxdb_data.bak 443.5 MB
After (ubuntu cp):
influxdb_data.ubuntu.bak 380.2 MB
NB: this pull request is not about size, but rather about correctness. A clone should be identical. Not preserving hard links, might actually break apps that depend on it. (like the influxdb database mentioned above)