# Enable the EPEL REPO if you haven't already sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm # Install the necessary packages sudo yum install fuse sshfs -y sudo modprobe fuse # add modprobe fuse to the startup with rc.local to make sure the FUSE module is loaded upon a reboot NEW_CONTENT="modprobe fuse" FILEPATH="/etc/rc.local" echo "`sudo cat $FILEPATH` `echo $NEW_CONTENT`" | sudo tee $FILEPATH
CentOS 6.5 - Setup SSHFS
Dev Inside A Docker Container With SSHFS
Many of you may have already discovered Docker, but have been put off using it due to the prospect of it killing your development cycle because you are rebuilding the container after every change.
We are going to address this by mounting the files directly within the container with SSHFS. This will allow us to make changes in our IDE or text editor, and see them take place immediately inside the container, removing the need to keep rebuilding.
Prerequisites
This tutorial assumes you already have a built container (or a way to build one) and a "project" consisting of a codebase, such as a website. It also assumes that your codebase is on a Linux host that you want to share from. I will be using an Ubuntu 14.04 container, but the theory should also apply to other Linux OS types.
sshfs -o allow_other $USER@$IP_OF_CODE_HOST:/full/path/to/codebase /path/to/mount
Ubuntu 14.04 - Share SSHFS Folders
# Uncomment the line user_allow_other in the fuse config sudo sed -i 's;#user_allow_other;user_allow_other;' /etc/fuse.conf # Add yourself to the fuse group sudo usermod -a -G fuse $USER
Now you will need to log out and in again for the changes to take effect. You will also need to remember to use the
sshfs -o allow_other user@hostname:/path/to/dir /path/to/mount