This is a simple example of how to mount an S3 bucket to a local directory and run a Python script that reads a file from the mounted directory.
- Clone the repository
git clone https://github.com/watcharap0n/s3mountpoint.git
- Navigate to the project directory
cd s3mountpoint
- Build the Docker image
**First, you need to set the ./entrypoint.sh
file for the S3 bucket you want to mount. Replace the bucket_name
with your S3 bucket name.
sudo docker build -f Dockerfile.s3mp -t python-s3mountpoint .
- Run the Docker container
sudo docker run --rm -it --device /dev/fuse --privileged python-s3mountpoint
Example output: