Skip to content

Instantly share code, notes, and snippets.

@impactmass
Last active June 23, 2018 19:54
Show Gist options
  • Save impactmass/a544429746e88a0f5e3fc3b07caf9772 to your computer and use it in GitHub Desktop.
Save impactmass/a544429746e88a0f5e3fc3b07caf9772 to your computer and use it in GitHub Desktop.
Accept input from a file

I've always used this to load an image from a tar

docker load < image.tar

is same as:

docker load --input image.tar

Useful when I had to run something like:

cat docker-cache/docker-tags.txt | xargs -t -I % docker load < docker-cache/images/%

That fails because loading the file into stdin gets evaluated first before the value from xargs.

cat docker-cache/docker-tags.txt | xargs -t -I % docker load --input docker-cache/images/%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment