⚠️This repository is no longer maintained by Lukas Martinelli.
A common use case with Docker is executing a virtualized process on a directory and capture stdout and mutated files.
docksend.sh is a quick and dirty solution for doing that remotely via SSH without setting up Docker Remote API access.
docksend.sh is a 100 line bash script which let's you send docker commands
to a remote Docker host and capture the output and modified files:
- connect to your Docker host server
- rsync local directory to server
- pull down image
- run docker command on server and print stdout
- rsync changes made to directory
docksend.sh is thought for relatively short tasks like:
- Generate PDF
- Compile C++ code
- Linting code
- install rsync and ssh client
wget https://raw.githubusercontent.com/lukasmartinelli/docksend/master/docksend.sh chmod +x docksend.sh
Or if you are using Arch install it with
yaourt docksend which will put
usage: ./dockdo.sh [-v docker_volume] [user@]hostname docker_image [command]
-v: bind a local directory to a docker volume (default:
-d: sync local directory to specific folder on remote machine (default: temp directory that is deleted afterwards)
-i: ssh key used for connection
-p: pull docker image silently before running command (no cluttered stdout)
If you want verbose output specify the
env variable (
Create PDF with LaTeX
Create a PDF without installing the full texlive suite locally.
docksend.sh you should now have a tex.pdf file in your folder.
./docksend.sh email@example.com ontouchstart/texlive-full pdftex tex.tex
In this example we omited the
-v volume binding. This means that
will automatically bind the current directory to
/root and set the working
/root as well.
git clone firstname.lastname@example.org:NathanEpstein/markov.git ./docksend.sh -v markov:/root email@example.com lukasmartinelli/docker-flint /root
-vwe bind the local
markovdirectory to the docker
- because we did not specify an explicit destination a temp directory is created
- we pull the
lukasmartinelli/docker-flintdocker image and execute it with
created tempdir firstname.lastname@example.org:/tmp/tmp.2ap1z7oX9G for syncing syncing markov up to email@example.com:/tmp/tmp.2ap1z7oX9G sending incremental file list ./ .gitignore Makefile README.md markov.cpp markov.h sent 3,006 bytes received 117 bytes 694.00 bytes/sec total size is 6,832 speedup is 2.19 /root/markov.h(1): Missing include guard. /root/markov.h(1): Missing include guard. syncing firstname.lastname@example.org:/tmp/tmp.2ap1z7oX9G down to markov receiving incremental file list sent 21 bytes received 112 bytes 29.56 bytes/sec total size is 6,832 speedup is 51.37 deleted tempdir email@example.com:/tmp/tmp.2ap1z7oX9G