Skip to content

Instantly share code, notes, and snippets.

@sirkkalap
Last active November 17, 2015 23:43
Show Gist options
  • Save sirkkalap/fe812216be223df310ae to your computer and use it in GitHub Desktop.
Save sirkkalap/fe812216be223df310ae to your computer and use it in GitHub Desktop.
Start up a test sftp-server with docker
#!/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