Mount AWS S3 Bucket on Ubuntu using S3FS: Docker Image

Facing issues in mounting your S3 bucket on ubuntu? Try using this docker image!

https://registry.hub.docker.com/u/ihealthtechnologies/s3-mount/

I created the image which has S3FS and Fuse installed on it. It includes Oracle Java 8 too. You need to supply your S3 bucket name and credentials while running the docker image as below. Then you can further configure it as per your needs!

Looking forward to your feedback!

Run the command below to use this image:

docker pull ihealthtechnologies/s3-mount

docker run -it --rm --privileged -e AWS_ACCESS_KEY=?? -e AWS_SECRET_ACCESS_KEY=?? -e AWS_S3_BUCKET=yourBucket ihealthtechnologies/s3-mount /bin/bash

Advertisements

6 thoughts on “Mount AWS S3 Bucket on Ubuntu using S3FS: Docker Image

  1. Hi Matt,
    I was able to pull up the script below. You can add these scripts to your Dockerfile. Let me know if this works for you.

    # needed for s3-fuse
    lsb_release -a
    apt-get –force-yes update
    apt-get –force-yes install -y build-essential libfuse-dev libcurl4-openssl-dev libxml2-dev mime-support automake libtool wget tar git unzip

    # jdk installation, optional.
    echo “deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main” | tee /etc/apt/sources.list.d/webupd8team-java.list
    echo “deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main” | tee -a /etc/apt/sources.list.d/webupd8team-java.list
    apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys EEA14886
    apt-get –force-yes update
    echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
    apt-get install -y oracle-java8-installer
    apt-get install -y oracle-java8-set-default

    cd ~

    # This is optional, you might not need this.
    wget –no-check-certificate –no-cookies –header “Cookie: oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip
    rm -rf ~/UnlimitedJCEPolicyJDK8/
    unzip jce_policy-8.zip -d ~/
    mv -v ~/UnlimitedJCEPolicyJDK8/local_policy.jar /usr/lib/jvm/java-8-oracle/jre/lib/security/
    mv -v ~/UnlimitedJCEPolicyJDK8/US_export_policy.jar /usr/lib/jvm/java-8-oracle/jre/lib/security/

    # s3-fuse
    rm -rf /usr/src/s3fs-fuse
    git clone https://github.com/s3fs-fuse/s3fs-fuse/ /usr/src/s3fs-fuse
    cd /usr/src/s3fs-fuse && ./autogen.sh && ./configure && make && make install
    mkdir -p /mnt/s3
    echo $AWS_ACCESS_KEY:$AWS_SECRET_ACCESS_KEY > /root/.passwd-s3fs
    chmod 600 /root/.passwd-s3fs

    echo “/usr/local/bin/s3fs $AWS_S3_BUCKET /mnt/s3” > /usr/local/mount.sh

    # run /usr/local/mount.sh to mount S3 bucket.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s