This is a quick start guide to run a S3 compatible open source object storage server using MinIO.
The docker image used in this guide:
S3 compatible object storage server endpoint on http://minio:9000
with access key minio
and secret miniosecret
contains bucket mybucket
which is accessible from our docker network development
$ docker run -d --name minio -v "minio-data:/data" --network development -p 9000:9000 -e MINIO_ACCESS_KEY=minio -e MINIO_SECRET_KEY=miniosecret minio/minio server /data
Point your web browser to http://your-docker-host:9000 and ensure MinIO server has started successfully.
Create a mc command alias to run the MinIO client via docker image minio/mc:
$ alias mc='docker run -it --rm --name mc --network development -v "minio-mc-root:/root" minio/mc $@'
Add new alias pointed to our previous created MinIO server
$ mc alias set minio http://minio:9000 minio miniosecret
Confirm the server alias is added correctly
$ mc alias list
Check our server status
$ mc admin info minio
Find more command with
mc help
Create a new bucket called mybucket
$ mc mb minio/mybucket
Confirm the bucket was created
$ mc ls minio
Create the aws command alias first
$ alias aws='docker run -it --rm --name aws-cli --network development -v "aws-cli-root:/root" amazon/aws-cli --endpoint-url http://minio:9000 $@'
Configure the aws cli using interactive setup
$ aws configure
Enter this while asked:
Name | Value |
---|---|
Access Key | minio |
Secret | miniosecret |
Default Region | us-east-1 |
Default Output | json |
Finally, list our bucket
$ aws s3 ls
Backup the objects to our local directory
$ aws s3 sync s3://mybucket /data
Note: this command will also delete local file that not exists on the storage server
$ aws s3 cp s3://mybucket /data --recursive
Note: this command will download recursively including the folder
Set the bucket policy public
$ mc anonymous set public minio/mybucket
Now should be able to access the object via URL http://minio:9000/mybucket/[object_name]
$ mc anonymous set none myminio/file
$ mc anonymous set download myminio/file/*