Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write a complete Dockerfile for MinIO service #9

Closed
orsk-moscow opened this issue Apr 14, 2023 · 2 comments · Fixed by #10
Closed

Write a complete Dockerfile for MinIO service #9

orsk-moscow opened this issue Apr 14, 2023 · 2 comments · Fixed by #10
Assignees
Labels
enhancement New feature or request

Comments

@orsk-moscow
Copy link
Owner

orsk-moscow commented Apr 14, 2023

Task

Write a complete Dockerfile for MinIO service

Details

  • MinIO service is a high performance object storage server compatible with Amazon S3 APIs.
  • use the official MinIO image from Docker Hub, which is based on Alpine Linux and has a minimal footprint.
@orsk-moscow orsk-moscow self-assigned this Apr 14, 2023
@orsk-moscow orsk-moscow added the enhancement New feature or request label Apr 14, 2023
@orsk-moscow
Copy link
Owner Author

orsk-moscow commented Apr 14, 2023

FROM minio/minio

# The next step is to define the environment variables that will be used by the MinIO service. 
# These include the access key and secret key for authentication, the bucket name for storing objects, and the port number for exposing the service. 
# We can use the environment instruction in docker-compose file to do this:

environment:
    MINIO_ACCESS_KEY: minio
    MINIO_SECRET_KEY: minio123
    MINIO_BUCKET: mybucket
    MINIO_PORT: 9000

# The third step is to create the bucket that will store our objects. 
# We can use the RUN instruction to execute a command that will use the MinIO client (mc) to create the bucket. 
# We need to make sure that the MinIO client is installed in our image before running this command. 
# We can use the apk command to install it from Alpine's package manager:

RUN apk add --no-cache minio-client && \
    mc config host add myminio http://localhost:9000 $MINIO_ACCESS_KEY $MINIO_SECRET_KEY && \
    mc mb myminio/$MINIO_BUCKET

# The final step is to specify the command that will run when our container is started. 
# We want to run the MinIO server with the specified port and bucket name. 
# We can use the CMD instruction to do this:

CMD ["server", "--address", ":$MINIO_PORT", "/data/$MINIO_BUCKET"]

@orsk-moscow
Copy link
Owner Author

WARNING: MINIO_ACCESS_KEY and MINIO_SECRET_KEY are deprecated.
s3          |          Please use MINIO_ROOT_USER and MINIO_ROOT_PASSWORD

orsk-moscow added a commit that referenced this issue Apr 14, 2023
@orsk-moscow orsk-moscow linked a pull request Apr 14, 2023 that will close this issue
orsk-moscow added a commit that referenced this issue Apr 14, 2023
This was referenced Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant