MOS3
is a mock application for Amazon S3, meaning My Own S3
, pronounced mɒsˈθri
.
Run the following command:
# https://hub.docker.com/r/tttol/mos3
docker run -p 3333:3333 -v ./upload:/app/upload -it --rm tttol/mos3:latest
Then access http://localhost:3333/s3.
[!NOTE] You can replace
./upload
with any path you prefer.
Files uploaded to MOS3 will be saved in /app/upload
.
This means that the files and directories in MOS3 will appear in the host machine's path specified with -v ./upload:/app/upload
.
The compose.yml
file is here.
[!NOTE] You can replace
./upload
with any path you prefer.
Run the following command:
docker compose up -d
Then access http://localhost:3333/s3.
You can upload a file or a directory using the "New File" or "New Dir" button at the top right of the screen.
Alternatively, you can create them in the directory mounted to /app/upload
using commands like touch
or mkdir
.
You can remove a file or directory using trash box icon at the right of each file/directory.
Alternatively, you can use commands like rm
in the directory mounted to /app/upload
to delete them.
You can download a file. Click the filename, then start downloading.
Here’s how to connect an application that uses Amazon S3 to MOS3.
By default, MOS3 runs on localhost:3333
. To access MOS3 from your application, set the S3 endpoint to http://localhost:3333
.
Here's an example using the AWS SDK for Java:
S3Client s3 = S3Client.builder()
.region(region)
.endpointOverride(new URI("http://localhost:3333"))
.serviceConfiguration(s3Configuration)
.build();
[!NOTE]
S3Configuration s3Configuration = S3Configuration.builder() .pathStyleAccessEnabled(true) // enable path style access .build();
When specifying
localhost
as the endpoint, you may need to enable path style access as shown above.
Thank you for your interest in contributing to our project. Please visit CONTRIBUTING.md for additional information on contributing to this project.