Last active
November 17, 2015 23:43
-
-
Save sirkkalap/fe812216be223df310ae to your computer and use it in GitHub Desktop.
Start up a test sftp-server with docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# https://gist.github.com/sirkkalap/fe812216be223df310ae#file-start-docker-sftp-server | |
BASEDIR=$(cd $(dirname $0); /bin/pwd) | |
if [ ! -z $DOCKER_MACHINE_NAME ]; then | |
ip=$(docker-machine ip $DOCKER_MACHINE_NAME) | |
docker run -d \ | |
--name sftp_server \ | |
-v $BASEDIR/share:/home/foo/share \ | |
-p 22222:22 \ | |
atmoz/sftp \ | |
foo:123:1000 && \ | |
echo "sftp://${ip}:22222/ - username: foo password: 123" && \ | |
echo "sftp -P 22222/ foo@${ip}" | |
else | |
echo "docker-machine is needed." | |
echo "Check your environment for \$DOCKER_MACHINE_NAME" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment